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: preserve push messages in cache until they are seen by client (#15764) (CP: 9.0) #15826

Merged
merged 2 commits into from
Feb 9, 2023

Conversation

mcollovati
Copy link
Collaborator

Atmosphere caches messages when the client is disconnected, but unfortunately, it may happen that a message does not reach the client because of network disconnection during async response write operation. In this case, the message is not cached and will be completely lost, causing a UI resynchronization request. This change preserves messages in broadcaster cache until the client confirms that they have been processed, by sending the last seen server sync identifier on reconnection. This should prevent the need for a UI resynchronization. It may happen in some cases, e.g. back to online after being offline, that messages already seen will be sent to the client, but Flow will discard them.

Part of #15281
Fixes #15205

Co-authored-by: Teppo Kurki teppo.kurki@vaadin.com

…15764)

Atmospehere caches messages when the client is disconnected, but unfortunately it may happen that a message does not reach the client because of network disconnection during async response write operation. In this case the message is not cached and will be completely lost, causing a UI resynchronization request.
This change preserves messages in broadcaster cache until the client confirms that they have been processed, by sending the last seen server sync identifier on reconnection.
This should prevent the need for a UI resynchronization. It may happen in some cases, e.g. back to online after being offline, that messages already seen will be sent to the client, but Flow will discard them.

Part of #15281
Fixes #15205

Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com>
@sonatype-lift
Copy link

sonatype-lift bot commented Feb 6, 2023

🛠 Lift Auto-fix

Some of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1

# Download the patch
curl https://lift.sonatype.com/api/patch/github.com/vaadin/flow/15826.diff -o lift-autofixes.diff

# Apply the patch with git
git apply lift-autofixes.diff

# Review the changes
git diff

Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command:

curl https://lift.sonatype.com/api/patch/github.com/vaadin/flow/15826.diff | git apply

Once you're satisfied, commit and push your changes in your project.

Footnotes

  1. You can preview the patch by opening the patch URL in the browser.

@github-actions
Copy link

github-actions bot commented Feb 6, 2023

Unit Test Results

   781 files  +1     781 suites  +1   26m 15s ⏱️ -15s
5 801 tests +5  5 750 ✔️ +6  51 💤  - 1  0 ±0 
5 852 runs  +7  5 800 ✔️ +8  52 💤  - 1  0 ±0 

Results for commit 12bb180. ± Comparison against base commit 5a90b09.

♻️ This comment has been updated with latest results.

@mshabarov mshabarov requested a review from tepi February 9, 2023 08:35
@sonarcloud
Copy link

sonarcloud bot commented Feb 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tepi tepi merged commit 4abc8fd into 9.0 Feb 9, 2023
@tepi tepi deleted the cherry/cherrypick-15764-to-9.0 branch February 9, 2023 09:09
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.

3 participants