[AIT-207] Partial object sync#117
[AIT-207] Partial object sync#117lawrence-forooghian merged 5 commits intointegration/protocol-v6from
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughA refactoring replaces array-based sync object storage with a dedicated SyncObjectsPool type that manages partial sync message merging and accumulation. SyncObjectsPool validates, merges map entries, and handles counter states during OBJECT_SYNC sequences. Changes
Sequence DiagramsequenceDiagram
participant Channel
participant InternalDefaultRealtimeObjects
participant SyncObjectsPool
participant ObjectsPool
Channel->>InternalDefaultRealtimeObjects: Receive OBJECT_SYNC message
InternalDefaultRealtimeObjects->>SyncObjectsPool: accumulate(objectMessage)
activate SyncObjectsPool
Note over SyncObjectsPool: Validate state & object type<br/>Merge map entries / handle tombstone<br/>Store or update entry
SyncObjectsPool-->>InternalDefaultRealtimeObjects: Pool updated
deactivate SyncObjectsPool
Channel->>InternalDefaultRealtimeObjects: Receive next OBJECT_SYNC (or end)
InternalDefaultRealtimeObjects->>SyncObjectsPool: accumulate(objectMessage)
activate SyncObjectsPool
Note over SyncObjectsPool: Continue merging partial data
SyncObjectsPool-->>InternalDefaultRealtimeObjects: Pool updated
deactivate SyncObjectsPool
InternalDefaultRealtimeObjects->>ObjectsPool: nosync_applySyncObjectsPool(pool)
activate ObjectsPool
loop For each entry in pool
ObjectsPool->>ObjectsPool: Create/update object with merged state
end
ObjectsPool-->>InternalDefaultRealtimeObjects: Objects applied
deactivate ObjectsPool
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cf6edee to
a2a010e
Compare
7689879 to
dadaade
Compare
a2a010e to
67a92dd
Compare
dadaade to
ee5b2f9
Compare
67a92dd to
b900be3
Compare
ee5b2f9 to
dff72b2
Compare
b900be3 to
e1438f6
Compare
ffc512f to
02bfedb
Compare
e1438f6 to
1989994
Compare
3a18180 to
7ec81af
Compare
1989994 to
70d9862
Compare
7ec81af to
65b36dc
Compare
70d9862 to
183c690
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
3d02fe7 to
18df1c8
Compare
18df1c8 to
cbd73a9
Compare
cbd73a9 to
00d0efc
Compare
15dfe04 to
2dcf9bb
Compare
Will be useful for some upcoming tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Give the sync objects pool its own type instead of using a bare [SyncObjectsPoolEntry] array. This makes the concept explicit and is preparation for implementing partial object sync, which will expand the capabilities of this type. I wouldn't pay too much attention to the tests; they'll be replaced soon. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Port the two integration tests added in ably-js commit b20d3ed: - OBJECT_SYNC sequence builds object tree across multiple sync messages - OBJECT_SYNC does not break when receiving an unknown object type Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements the changes from spec commits 1f22417, 9f4d7de, and 963ec30, which allow the server to split a large object across multiple OBJECT_SYNC protocol messages. The new integration test is ported from ably-js commit d0bc431. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
00d0efc to
12faf8b
Compare
| /// Applies the objects gathered during an `OBJECT_SYNC` to this `ObjectsPool`, per RTO5c1 and RTO5c2. | ||
| internal mutating func nosync_applySyncObjectsPool( | ||
| _ syncObjectsPool: [SyncObjectsPoolEntry], | ||
| _ syncObjectsPool: SyncObjectsPool, |
There was a problem hiding this comment.
Can we split the method into existing / non-existing object branches? It's getting pretty big
There was a problem hiding this comment.
This method hasn't really been made larger by this PR but sure, seems like a good idea anyway — added 650f876
Requested by Evgenii in code review, for readability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30d867b
into
integration/protocol-v6
Note: This PR is based on top of #114; please review that one first.
Implements the following spec commits, which allow the server to split a large object over multiple
OBJECT_SYNCmessages.See commit message for more details.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests