Skip to content

A whole write on a row a teammate moved waits for the page its row was last shown on - #736

Merged
SunkenInTime merged 1 commit into
mainfrom
t3/last-shown-page
Nov 24, 2026
Merged

SunkenInTime merged 1 commit into
mainfrom
t3/last-shown-page

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

No picture: this is a change to the cloud queue's package. The store's sender that uses it runs only in desktop driver builds, so no user meets it yet.

A teammate moves an item to another page. This device then makes a field merge on it that lands at a revision the queue didn't predict. Later, after a reconnect, the user makes a whole-row write on that item. That write waits for a result of the item, but the queue asked for it on the page the op was made on, the page the editor still draws the item on. Reading that page can never settle it, so the write waited for good. This is the stall the random model found at seed 375, once the model checks after every step that reading what an op waits for settles it.

The fix: the write waits on the page a result last showed the row on, and falls back to the page the op was made on only when no result has shown the row.

This came out of #732. It's a stall inside one life of a row, with no purge involved, so it gets its own PR ahead of the purged-row rework.

Tests

  • cloud_model_test.dart:
    • the model now checks after every step that nothing stalls. For each op waiting on a result, it reads that result from the server model and fails if the op still waits on the same hold. Minimum: 200 such checks across the default seeds.
    • seed 375: a whole write behind this device's own landed work, on a row a teammate moved to another page, waits for that page and is settled by reading it runs seed 375 in both folding modes. It fails without the change (op7 waits for ElementTarget(e2), and reading it from the server now leaves it waiting).
  • cloud_moved_row_test.dart, a whole write behind this device's own landed work waits for the page the row was last shown on, not the page the editor still draws it on: the directed case. It fails without the change.
  • The default 200 seeds pass with and without the change. Seed 375 is outside them, which is why it's a named test.

Package: dart analyze is clean, infos included. All 1,058 tests pass, and the comments check passes.

ci: library

Summary by CodeRabbit

  • Bug Fixes
    • Edits queued behind your own completed row move now wait for a result from the page where the row was last shown, rather than the page still displayed by the editor. This helps queued work proceed when the relevant result is available and avoids unnecessary waiting.
  • Documentation
    • Clarified which page queued edits wait on when a row has moved.

… its row was last shown on, so a row a teammate moved to another page is settled by reading that page
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The queue now falls back to a row’s last shown page when selecting the page for a whole-row wait and the known row has no page. Documentation and tests describe and verify the selection, including model checks that server results settle applicable waits.

Changes: Whole-row wait page selection

Layer / File(s) Summary
Page selection and focused regression
packages/icarus_library/lib/src/cloud/queue.dart, packages/icarus_library/README.md, packages/icarus_library/test/cloud_moved_row_test.dart
_wholeBehindOwn uses the row’s last shown page when the known row has no page. The README documents the fallback, and a regression test checks that a whole write after a landed move waits on page-b.
Model checks for waiting entries
packages/icarus_library/test/cloud_model_test.dart
The model test simulates server reads for AwaitingResult holds on waiting entries and checks that the holds clear. A new seed test runs with folding enabled and disabled.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

  • SunkenInTime/icarus#688 — Defines the queue contract for revision-checked work behind the device’s own work, which this change updates for whole-row waits.
  • SunkenInTime/icarus#690 — Stores the latest results shown, whose page information this change uses for wait-page selection.
Merge Risk: Minimal · up to 2585e

The change makes a whole-row write wait on the page where the row was last shown, so reading that page can settle the write. It is covered by a directed regression test and a model-based check. No remaining merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: a whole-row write behind a teammate's moved row now waits for the page where the row was last shown. The raw summary and objectives confirm that _wholeBehindOwn now fa…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a whole-row write behind a teammate's moved row now waits for the page where the row was last shown. The raw summary and objectives confirm that _wholeBehindOwn now falls back to the row's last shown page, and that a directed test covers this case. The title is specific and concise, and it matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 03d66c3f-3b70-4eac-a36f-8aa4d5bff198
Commits

Reviewing files that changed from the base of the PR and between d2ec6c1 and 2585ed1.

Files selected for processing: 4

  • packages/icarus_library/README.md
  • packages/icarus_library/lib/src/cloud/queue.dart
  • packages/icarus_library/test/cloud_model_test.dart
  • packages/icarus_library/test/cloud_moved_row_test.dart

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@SunkenInTime
SunkenInTime merged commit d7c37dc into main Nov 24, 2026
19 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