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: allow null response in logout #20057

Merged
merged 9 commits into from
Oct 2, 2024
Merged

Conversation

tltv
Copy link
Member

@tltv tltv commented Sep 25, 2024

Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.

Fixes: #20017

Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.

Fixes: #20017
Copy link

github-actions bot commented Sep 25, 2024

Test Results

1 137 files  ± 0  1 137 suites  ±0   1h 12m 37s ⏱️ + 4m 46s
7 401 tests + 2  7 351 ✅ + 3  50 💤 ±0  0 ❌ ±0 
7 773 runs  +19  7 713 ✅ +20  60 💤 ±0  0 ❌ ±0 

Results for commit 7c6e7e7. ± Comparison against base commit 69e2800.

♻️ This comment has been updated with latest results.

When logging out with AuthenticationContext#logout, tolerate null response better in case when running with @Push(transport = Transport.WEBSOCKET), or when response is null for some other reason.
@tltv tltv marked this pull request as ready for review September 26, 2024 13:13
@mcollovati mcollovati self-requested a review September 30, 2024 09:41
Makes logout also work in WEBSOCKET mode by automatically switching to WEBSOCKET_XHR for one additional request that executes logout.
@tltv
Copy link
Member Author

tltv commented Oct 1, 2024

Updated logout to also work properly with WEBSOCKET transport mode. Thanks @mcollovati for the idea and code to switch temporarily to WEBSOCKET_XHR just for one request to do the logout.

@vaadin-bot vaadin-bot added +1.0.0 and removed +0.0.1 labels Oct 1, 2024
Copy link

sonarqubecloud bot commented Oct 1, 2024

@tltv tltv merged commit 99d8266 into main Oct 2, 2024
26 checks passed
@tltv tltv deleted the fix/20017-NPE-AuthenticationContext branch October 2, 2024 07:39
vaadin-bot pushed a commit that referenced this pull request Oct 2, 2024
Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.
Tolerate null response better in case when running with @Push(transport = Transport.WEBSOCKET), or when response is null for some other reason.
Makes logout also work in WEBSOCKET mode by automatically switching to WEBSOCKET_XHR for one additional request that executes logout.

Fixes: #20017
vaadin-bot pushed a commit that referenced this pull request Oct 2, 2024
Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.
Tolerate null response better in case when running with @Push(transport = Transport.WEBSOCKET), or when response is null for some other reason.
Makes logout also work in WEBSOCKET mode by automatically switching to WEBSOCKET_XHR for one additional request that executes logout.

Fixes: #20017
@vaadin-bot
Copy link
Collaborator

Hi @tltv and @tltv, when i performed cherry-pick to this commit to 24.3, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 99d8266
error: could not apply 99d8266... fix: allow null response in logout (#20057)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

tltv added a commit that referenced this pull request Oct 2, 2024
Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.
Tolerate null response better in case when running with @Push(transport = Transport.WEBSOCKET), or when response is null for some other reason.
Makes logout also work in WEBSOCKET mode by automatically switching to WEBSOCKET_XHR for one additional request that executes logout.

Fixes: #20017
vaadin-bot added a commit that referenced this pull request Oct 2, 2024
Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.
Tolerate null response better in case when running with @Push(transport = Transport.WEBSOCKET), or when response is null for some other reason.
Makes logout also work in WEBSOCKET mode by automatically switching to WEBSOCKET_XHR for one additional request that executes logout.

Fixes: #20017

Co-authored-by: Tomi Virtanen <[email protected]>
vaadin-bot added a commit that referenced this pull request Oct 2, 2024
Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.
Tolerate null response better in case when running with @Push(transport = Transport.WEBSOCKET), or when response is null for some other reason.
Makes logout also work in WEBSOCKET mode by automatically switching to WEBSOCKET_XHR for one additional request that executes logout.

Fixes: #20017

Co-authored-by: Tomi Virtanen <[email protected]>
mcollovati pushed a commit that referenced this pull request Oct 2, 2024
Don't throw NullPointerException in case of null VaadinServletResponse in AuthenticationContext#logout.
Tolerate null response better in case when running with @Push(transport = Transport.WEBSOCKET), or when response is null for some other reason.
Makes logout also work in WEBSOCKET mode by automatically switching to WEBSOCKET_XHR for one additional request that executes logout.

Fixes: #20017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException in AuthenticationContext.logout() because VaadinServletResponse is null
4 participants