vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
619 stars 167 forks source link

fix: delay session expiration handling to prevent canceling ongoing navigation #19983

Closed mcollovati closed 4 days ago

mcollovati commented 1 month ago

Attempts to fix the synchronization issue related to the usage of the Login reported in #12640. The Login component sends the UIDL request for the login event to the server and concurrently submits the form. If processing the form submission performs a session ID change and a request redirect, the UIDL requests might fail with a session expiration response. The Flow client then can cancel the first redirect because it reloads the page due to the session expiration. Lastly, the beacon request hits again a valid session, but a resynchronization is triggered because the previous UIDL request was rejected.

This change delays a bit the session expiration handling on Flow client, to allow a potential redirect to complete without being cancelled. However, the client application is immediately set in TERMINATED state.

github-actions[bot] commented 1 month ago

Test Results

1 146 files  ± 0  1 146 suites  ±0   1h 29m 34s ⏱️ + 4m 27s 7 489 tests ± 0  7 439 ✅ ± 0  50 💤 ±0  0 ❌ ±0  7 831 runs  +11  7 771 ✅ +11  60 💤 ±0  0 ❌ ±0 

Results for commit 197854e2. ± Comparison against base commit 6ef4c3e3.

:recycle: This comment has been updated with latest results.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

mshabarov commented 3 weeks ago

Preferably to apply this fix first.

sonarcloud[bot] commented 4 days ago

Quality Gate Passed Quality Gate passed

Issues
135 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

vaadin-bot commented 4 days ago

Hi @mcollovati and @caalador, when i performed cherry-pick to this commit to 2.11, i have encountered the following issue. Can you take a look and pick it manually? Error Message: Error: Command failed: git cherry-pick 80813cb4a6f8c58c1b1df962b79b83f7c8cf20cc error: could not apply 80813cb4a6... fix: delay session expiration handling to prevent canceling ongoing navigation (#19983) 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".

vaadin-bot commented 4 days ago

Hi @mcollovati and @caalador, when i performed cherry-pick to this commit to 23.5, i have encountered the following issue. Can you take a look and pick it manually? Error Message: Error: Command failed: git cherry-pick 80813cb4a6f8c58c1b1df962b79b83f7c8cf20cc error: could not apply 80813cb4a6... fix: delay session expiration handling to prevent canceling ongoing navigation (#19983) 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".