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

improve handling for potentially missed SSEs #1504

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

srabraham
Copy link
Member

This starts telling EventSource clients, upon connection, which SSE ID was the most recently published. That allows the client to know whether it should reload its data pages to be in sync with the server. I store the previous SSE ID in LocalStorage, so that all tabs can share that value together.

This makes the synchronization mechanism very resilient to the EventSource connection needing to be reestablished.

This simplifies some of the _eventsource.py code by removing unused code around replaying events (we were never using that).

This starts telling EventSource clients, upon connection, which SSE
ID was the most recently published. That allows the client to know
whether it should reload its data pages to be in sync with the server.
I store the previous SSE ID in LocalStorage, so that all tabs can share
that value together.

This makes the synchronization mechanism very resilient to the
EventSource connection needing to be reestablished.

This simplifies some of the _eventsource.py code by removing unused
code around replaying events (we were never using that).
@srabraham srabraham enabled auto-merge (rebase) January 7, 2025 17:06
@srabraham srabraham merged commit 9f68e44 into master Jan 7, 2025
11 checks passed
@srabraham srabraham deleted the 2025-01-06-modal-style branch January 7, 2025 17:07
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 69.74%. Comparing base (b5c970d) to head (05e90a9).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/ims/application/_eventsource.py 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1504      +/-   ##
==========================================
+ Coverage   69.64%   69.74%   +0.10%     
==========================================
  Files         181      181              
  Lines        8998     8985      -13     
  Branches     1494     1489       -5     
==========================================
  Hits         6267     6267              
+ Misses       2626     2613      -13     
  Partials      105      105              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant