-
Notifications
You must be signed in to change notification settings - Fork 57
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
refactor: notify clients with acceptance/rejection of events instead of snapshots #2772
Conversation
This changes the way updates are sent to the clients after the acceptance/rejection of an event on the server. With this applied, the REJECT event is removed and SNAPSHOT event containing the current state of the server-side signal only when (re)subscribing to a signal and not after each update. The events received by the server regarding each update to a signal is propagated to the clients with a boolean value that indicates the acceptance/rejection of the operation so clients decide to discard/apply/confirm the operation on their local value. This unifies the way with how List signals are going to work: to get snapshot events with the current state on the server only when subscribing signals (which can be a long list of values), and then getting updates of individual operations for subsequent updates, one at a time.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2772 +/- ##
==========================================
+ Coverage 92.29% 92.33% +0.04%
==========================================
Files 81 81
Lines 2660 2674 +14
Branches 677 682 +5
==========================================
+ Hits 2455 2469 +14
Misses 156 156
Partials 49 49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
…of snapshots (#2772) * refactor: notify clients with acceptance/rejection of events This changes the way updates are sent to the clients after the acceptance/rejection of an event on the server. With this applied, the REJECT event is removed and SNAPSHOT event containing the current state of the server-side signal only when (re)subscribing to a signal and not after each update. The events received by the server regarding each update to a signal is propagated to the clients with a boolean value that indicates the acceptance/rejection of the operation so clients decide to discard/apply/confirm the operation on their local value. This unifies the way with how List signals are going to work: to get snapshot events with the current state on the server only when subscribing signals (which can be a long list of values), and then getting updates of individual operations for subsequent updates, one at a time. * formatter: format * remove unused import * add test
Description
This changes the way updates are sent to the clients after the acceptance/rejection of an event on the server. With this applied, the REJECT event is completely removed, and SNAPSHOT events containing the current state of the server-side signal only when (re)subscribing to a signal and not after each update. The events received by the server regarding each update to a signal is propagated to the clients with a boolean value that indicates the acceptance/rejection of the operation, so clients decide to discard/apply/confirm the operation on their local value.
This unifies the way with how List signals are going to work: to get snapshot events with the current state on the server only when subscribing signals (which can be a long list of values - at least for starters), and then getting updates of individual operations for subsequent updates, one at a time.
Part of #2654