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

refactor: notify clients with acceptance/rejection of events instead of snapshots #2772

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

taefi
Copy link
Contributor

@taefi taefi commented Sep 26, 2024

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

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.
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.33%. Comparing base (5a7861f) to head (629aa8a).
Report is 2 commits behind head on main.

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              
Flag Coverage Δ
unittests 92.33% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link

sonarcloud bot commented Sep 27, 2024

@taefi taefi merged commit 0b8144e into main Sep 27, 2024
15 checks passed
@taefi taefi deleted the taefi/refactor/get-rid-of-reject-event branch September 27, 2024 10:21
cromoteca pushed a commit that referenced this pull request Sep 27, 2024
…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
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.

2 participants