Skip to content

Align WebSession#save implementations with API clarifications #1135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vpavic opened this issue Jul 27, 2018 · 3 comments
Closed

Align WebSession#save implementations with API clarifications #1135

vpavic opened this issue Jul 27, 2018 · 3 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@vpavic
Copy link
Contributor

vpavic commented Jul 27, 2018

We should ensure our WebSession#save implementations are aligned with API clarifications recently introduced in SPR-17051.

Namely:

/**
 * Save the session through the {@code WebSessionStore} as follows:
 * <ul>
 * <li>If the session is new (i.e. created but never persisted), it must have
 * been started explicitly via {@link #start()} or implicitly by adding
 * attributes, or otherwise this method should have no effect.
 * <li>If the session was retrieved through the {@code WebSessionStore},
 * the implementation for this method must check whether the session was
 * {@link #invalidate() invalidated} and if so return an error.
 * </ul>
 * <p>Note that this method is not intended for direct use by applications.
 * Instead it is automatically invoked just before the response is
 * committed is committed.
 * @return {@code Mono} to indicate completion with success or error
 */
Mono<Void> save();
@vpavic vpavic added type: enhancement A general enhancement Data Store labels Jul 27, 2018
@vpavic vpavic added this to the 2.1.0.M2 milestone Jul 27, 2018
@vpavic vpavic modified the milestones: 2.1.0.M2, 2.1.0.M3 Aug 20, 2018
@vpavic vpavic modified the milestones: 2.1.0.M3, 2.1.0.RC1 Sep 10, 2018
@vpavic
Copy link
Contributor Author

vpavic commented Sep 12, 2018

Ping @rwinch - what's your take on this?

In practice, our session repository implementations have always ignored attempts to update an invalid session i.e. the one that's missing from the store.

@rwinch
Copy link
Member

rwinch commented Sep 13, 2018

I agree. We should ensure our implementation is aligned with the API clarifications

@vpavic vpavic self-assigned this Sep 17, 2018
@vpavic vpavic closed this as completed in 002136b Sep 18, 2018
@vpavic
Copy link
Contributor Author

vpavic commented Sep 18, 2018

ReactiveRedisOperationsSessionRepository is now aligned with WebSession#save API and will return a Mono#error containing IllegalStateException when an invalid (i.e. not present in the data store) RedisSession was passed in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants