Skip to content
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

fix: fix session serialization for PUSH with websocket #120

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

mcollovati
Copy link
Contributor

Description

When PUSH transport is websocket, the request associated to atmosphere is a stub implementation that always returns false for 'isRequestedSessionIdValid()' preventing PushSessionTracker to serialize the session.
In addition, accessing the request from a background thread may throw IllegalStateException if the servlet container is recycling request objects (e.g. Tomcat facade). With this change, the session validity is checked against the SessionListener that is already observing session lifecycle events.

Fixes #119

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

When PUSH transport is websocket, the request associate to atmosphere is a stub implementation
that always return false for 'isRequestedSessionIdValid()' preventing PushSessionTracker to
serialize the session.
In addition, accessing the request from a background thread may throw IllegalStateException if
the servlet container is recycling request objects (e.g. Tomcat facade).
With this change, the session validiy is checked against the SessionListener that is already
observing session lifecycle events.

Fixes #119
@heruan heruan requested a review from tamasmak April 10, 2024 08:03
@tamasmak tamasmak merged commit f0c58ed into main Apr 19, 2024
2 checks passed
@tamasmak tamasmak deleted the issues/119_fix_pushsessiontracker_session_check branch April 19, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PushSessionTracker not always serializing session when transport is websocket
2 participants