Skip to content

Run random schedules of edits, lost answers and teammate changes - #554

Merged
SunkenInTime merged 1 commit into
mainfrom
t3/random-sync-schedules
Nov 12, 2026
Merged

SunkenInTime merged 1 commit into
mainfrom
t3/random-sync-schedules

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Test only, nothing on screen. What it catches:

Code under test Seeds failing
main before #550 and #551 10 of the first 200
main now 0 of 10,000

Why

The sync tests are one scenario per bug: each was written after someone found the bug. #550 and #551 fixed four bugs nobody had a scenario for, and this test found three of them (a lost item edit, a theme change overwriting a teammate's map, and a regression in the first version of that fix). It is here so the next one is found before a user does.

What it does

One group, random schedules, in strategy_page_session_provider_test.dart. It uses the file's existing harness: the real page session, the real op queue and outbox, and _FakeServer.

From a seed it draws 30 steps out of: the user changes the map or theme, moves or retypes one of two texts; a teammate changes the map or retypes a third text; the next answer is lost; the connection drops or returns; the live read arrives; the pointer goes down or up; save; send. Then it goes online, lets everything send, and reads the server back. If the user is being asked about refused work, it takes the cloud's version.

It then requires:

  • the canvas shows what the server holds: map, theme, and each text's words and place;
  • the user's last words and place for their two texts are there, unless they were asked and took the cloud's;
  • the last change to the map is the one kept, with one stated exception (the user set it back to what their device last read while a teammate's newer change had not reached them);
  • the teammate's words are on the server and on the canvas;
  • nothing is left waiting and nobody is still being asked.

A failure prints the seed, every step, the canvas, queue and server after each settle round, and every batch sent.

200 seeds run by default, about 11 s. SYNC_SEEDS=10000 runs more; SYNC_SEEDS=1907,2673 replays named seeds.

Limits

  • The server is the file's Dart model, not Convex. The sync gauntlet covers the real server with a few scripted schedules; this covers many schedules against the model.
  • One user and one teammate, one page, texts only. No page add, delete or reorder, no lineups, no restart mid-schedule.
  • It does not model a read older than an acknowledged change, so it cannot see the one weakness Publish the outbox's summary and its waiting work together #550 left open.

ci: analyze test

One user edits a page and its strategy's map and theme while the network
fails under them and a teammate edits too, in an order drawn from a seed.
Once everything is sent and read back, the canvas must show what the
server holds, the user's last edit to each thing must be there unless
they were asked about it, and a teammate's edit to something the user
left alone must still be there.

200 seeds run by default. SYNC_SEEDS runs more, or replays named seeds.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@SunkenInTime
SunkenInTime merged commit 5a2d3b3 into main Nov 12, 2026
16 checks passed
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.

1 participant