-
Notifications
You must be signed in to change notification settings - Fork 3
[AIT-286] Fix BufferedObjectOperations clearing rules for LiveObjects sync #416
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
Open
VeskeR
wants to merge
1
commit into
main
Choose a base branch
from
AIT-286/fix-buffered-ops-rules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,7 @@ h3(#realtime-objects). RealtimeObjects | |
| *** @(RTO3b1)@ Upon initialization of the @ObjectsPool@, create a new @LiveMap@ (per "RTLM4":#RTLM4) with @objectId@ set to @root@ and add it to the @ObjectsPool@ | ||
| * @(RTO4)@ When a channel @ATTACHED@ @ProtocolMessage@ is received, the @ProtocolMessage@ may contain a @HAS_OBJECTS@ bit flag indicating that it will perform an objects sync, see "TR3":../features#TR3 . Note that this does not imply that objects are definitely present on the channel, only that there may be; the @OBJECT_SYNC@ message may be empty | ||
| ** @(RTO4c)@ Upon receipt of an @ATTACHED@ @ProtocolMessage@, the "RTO17":#RTO17 sync state must transition to @SYNCING@ if not already @SYNCING@. This must occur before performing any "RTO4b":#RTO4b actions. | ||
| ** @(RTO4d)@ If the @RESUMED@ flag (see "TR3":../features#TR3) is not set, the @BufferedObjectOperations@ list must be cleared without applying any buffered operations. This is because the realtime server caches the object state at the moment of channel attachment, so any previously buffered operations are no longer relevant to the state that will be received during the sync sequence | ||
| ** @(RTO4a)@ If the @HAS_OBJECTS@ flag is 1, the server will shortly perform an @OBJECT_SYNC@ sequence as described in "RTO5":#RTO5 | ||
| ** @(RTO4b)@ If the @HAS_OBJECTS@ flag is 0 or there is no @flags@ field, the sync sequence must be considered complete immediately, and the client library must perform the following actions in order: | ||
| *** @(RTO4b1)@ All objects except the one with id @root@ must be removed from the internal @ObjectsPool@ | ||
|
|
@@ -115,11 +116,12 @@ h3(#realtime-objects). RealtimeObjects | |
| * @(RTO5)@ The realtime system reserves the right to initiate an objects sync of the objects on a channel at any point once a channel is attached. A server initiated objects sync provides Ably with a means to send a complete list of objects present on the channel at any point | ||
| ** @(RTO5d)@ If an @OBJECT_SYNC@ @ProtocolMessage@ is received and "@ObjectMessage.object@":../features#TR4r is null or omitted, the client library should skip processing that @ProtocolMessage@ | ||
| ** @(RTO5e)@ When an @OBJECT_SYNC@ @ProtocolMessage@ is received with a @channel@ attribute matching the channel name, the "RTO17":#RTO17 sync state must transition to @SYNCING@ if not already @SYNCING@. This must occur before performing any "RTO5c":#RTO5c sync completion actions. | ||
| ** @(RTO5f)@ Note: The expected behavior for a server-initiated resync is that the @OBJECT_SYNC@ message will be preceded by an @ATTACHED@ message with @RESUMED@ flag not set, which clears buffered operations per "RTO4d":#RTO4d. However, if an @OBJECT_SYNC@ arrives after a previously completed sync without a preceding @ATTACHED@ message, the client library handles this on a best-effort basis: by transitioning to @SYNCING@ (per "RTO5e":#RTO5e) and starting to buffer @OBJECT@ messages (per "RTO8a":#RTO8a) from that point onwards (since the client does not know at which point the state being received was cached by the server). This best-effort handling is achieved implicitly through the existing spec points and requires no additional implementation | ||
| ** @(RTO5a)@ When an @OBJECT_SYNC@ @ProtocolMessage@ is received with a @channel@ attribute matching the channel name, the client library must parse the @channelSerial@ attribute: | ||
| *** @(RTO5a1)@ The @channelSerial@ is used as the sync cursor and is a two-part identifier: @<sequence id>:<cursor value>@ | ||
| *** @(RTO5a2)@ If a new sequence id is sent from Ably, the client library must treat it as the start of a new objects sync sequence, and any previous in-flight sync must be discarded: | ||
| **** @(RTO5a2a)@ The @SyncObjectsPool@ list must be cleared | ||
| **** @(RTO5a2b)@ The @BufferedObjectOperations@ list must be cleared | ||
| **** @(RTO5a2b)@ This clause has been deleted | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say replaced, not deleted |
||
| *** @(RTO5a3)@ If the sequence id matches the previously received sequence id, the client library should continue the sync process | ||
| *** @(RTO5a4)@ The objects sync sequence for that sequence identifier is considered complete once the cursor is empty; that is when the @channelSerial@ looks like @<sequence id>:@ | ||
| *** @(RTO5a5)@ An @OBJECT_SYNC@ may also be sent with no @channelSerial@ attribute. In this case, the sync data is entirely contained within the @ProtocolMessage@ | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deleted clause statement should end with a period for consistency with other deleted clauses in the specification (see RSN4c, TS3, etc. in features.textile).