Skip to content

[AIT-538] Update partial OBJECT_SYNC test to provoke the server to send an actual partial sync instead of injecting fake messages#2185

Merged
VeskeR merged 1 commit intomainfrom
AIT-538/partial-sync-integration-tests
Mar 20, 2026
Merged

[AIT-538] Update partial OBJECT_SYNC test to provoke the server to send an actual partial sync instead of injecting fake messages#2185
VeskeR merged 1 commit intomainfrom
AIT-538/partial-sync-integration-tests

Conversation

@VeskeR
Copy link
Contributor

@VeskeR VeskeR commented Mar 19, 2026

Resolves AIT-538

Summary by CodeRabbit

  • Tests
    • Added a REST-driven test that simulates large-value synchronization requiring the server to split protocol messages, verifies multiple partial sync fragments are received, and confirms correct merge and data integrity after a client reattaches.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b2ead492-967d-4c07-b21b-3472b5d8a45a

📥 Commits

Reviewing files that changed from the base of the PR and between c49bec7 and c41be17.

📒 Files selected for processing (1)
  • test/realtime/liveobjects.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/realtime/liveobjects.test.js

Walkthrough

Rewrote a test to create a REST client that uses the LiveObjects plugin, publish large map updates via REST to force server-side OBJECT_SYNC splitting, then attach a second realtime client to count OBJECT_SYNC messages and verify merged map values after sync.

Changes

Cohort / File(s) Summary
Test + helper
test/realtime/liveobjects.test.js
Added RestWithLiveObjects(helper, options) helper and threaded restChannel into scenario context. Replaced server-injected partial sync simulation with REST-driven large mapSet writes, created a second realtime client to attach and count OBJECT_SYNC (action === 20) messages, and validated merged large-key values. Removed previous manual partialMessages assembly and fake internal map references.

Sequence Diagram(s)

sequenceDiagram
  participant REST as REST Client\n(RestWithLiveObjects)
  participant Server as Server
  participant RT_A as Realtime Client A\n(publisher)
  participant RT_B as Realtime Client B\n(reattaching)
  participant TransportB as TransportB\n(onProtocolMessage)

  REST->>Server: publish three large `mapSet` updates
  Server->>RT_A: propagate realtime updates (may split OBJECT_SYNC)
  Note over Server,RT_A: Server stores split OBJECT_SYNC fragments
  RT_B->>Server: attach & request sync
  Server->>RT_B: send OBJECT_SYNC fragments (>=3 messages)
  RT_B->>TransportB: transport receives protocol messages
  TransportB->>TransportB: onProtocolMessage counts action === 20 messages
  TransportB-->>RT_B: deliver assembled state
  RT_B->>RT_B: verify all three large keys have expected values
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped to split a sync with glee,
Sent giant keys by REST, then came to see.
Three little messages danced through the air,
I counted them all with careful care.
Reattach, merge, and nibble a carrot — whee! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating a partial OBJECT_SYNC test to provoke actual server-sent partial syncs instead of injecting fake messages, which matches the core objective and changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch AIT-538/partial-sync-integration-tests
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.41.1)
test/realtime/liveobjects.test.js

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot temporarily deployed to staging/pull/2185/features March 19, 2026 11:51 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2185/bundle-report March 19, 2026 11:51 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2185/typedoc March 19, 2026 11:52 Inactive
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/realtime/liveobjects.test.js`:
- Around line 901-913: The test currently sizes probe payloads from
client.options.maxMessageSize which can diverge from the actual publish gate;
change the sizing to use connectionManager.connectionDetails.maxMessageSize when
computing largeValue so the seed writes (the loop calling entryInstance.set for
keys largeKey1/2/3) match the real publish limit; update the reference where
largeValue is computed and any uses of maxMessageSize in this block (including
the helper.recordPrivateApi call if needed) to read
connectionManager.connectionDetails.maxMessageSize instead of
client.options.maxMessageSize.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d415f7fc-98ca-4848-9fe3-985197791489

📥 Commits

Reviewing files that changed from the base of the PR and between 17be43e and c49bec7.

📒 Files selected for processing (1)
  • test/realtime/liveobjects.test.js

@VeskeR VeskeR force-pushed the AIT-538/partial-sync-integration-tests branch from c49bec7 to ea2f8e3 Compare March 19, 2026 14:22
@github-actions github-actions bot temporarily deployed to staging/pull/2185/bundle-report March 19, 2026 14:23 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2185/features March 19, 2026 14:23 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/2185/typedoc March 19, 2026 14:23 Inactive
…al partial sync instead of injecting fake messages

Resolves AIT-538
@VeskeR VeskeR merged commit c90f1c3 into main Mar 20, 2026
13 of 20 checks passed
@VeskeR VeskeR deleted the AIT-538/partial-sync-integration-tests branch March 20, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants