Skip to content

Renew presence from current state; scope open dialogs to their page - #244

Merged
SunkenInTime merged 1 commit into
t3code/unify-cloud-mainfrom
presence-review-fixes
Oct 3, 2026
Merged

SunkenInTime merged 1 commit into
t3code/unify-cloud-mainfrom
presence-review-fixes

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Two fixes for #243 that Greptile raised after it merged into #234's branch:

  • The room renews from the socket's current state. A renewal waits for its pass check. It then saved the state the socket had before that wait, so a "stopped editing" or a cursor move that arrived in between was undone, and newcomers saw a stale editing notice. It now reads the socket's state after the check, and renews nothing if the socket closed. I couldn't write a test that reproduces the interleaving: the Workers test runtime doesn't interleave the two messages, so a test passes with or without the fix. The fix rests on reading the code.
  • Open dialogs count only on the page they were opened on. A lineup dialog left open across a page change no longer counts as editing whatever shares its item ids on the new page. The updated provider test covers this.

Not changed: sending at most 8 groups matches the room's limit, and nobody edits more than 8 lineup groups at once.

Verified: presence/ typecheck is clean and 21/21 tests pass; the presence Flutter tests pass, 45/45.

🤖 Generated with Claude Code

RetriggerConfidence Score: 5/5

No issue caused by this PR was established that prevents merging.

What we checked:

  • T-Rex produced a proof for a posted P2 finding. T-Rex
  • In the PR run, a dialog built on old registered on new reported a group-new for the reused spot ID, and the base revision reported the same group-new in both cases, so the PR fixes ordinary navigation but leaves the same-frame case. T-Rex
  • The interleaving harness invokes the handler directly and tests the upgrade and authorization paths, returning 101 Switching Protocols for a valid upgrade and 401 Unauthorized for an invalid pass. T-Rex

Summary

Pass renewal now preserves the socket’s current cursor and editing state. A lineup dialog already open when the user changes pages no longer marks matching lineup IDs on the destination page as edited.

Reviews (1) · Last reviewed commit: "Renew presence from the socket's current..."

… their page

From Greptile on #243:

- A renewal awaits its pass check, then saved the socket's state from
  before the wait: a clear (or cursor move) that arrived meanwhile was
  undone, and newcomers saw a stale "editing". It now renews what the
  socket holds after the wait, and nothing for a socket that closed.
- A lineup dialog edits the groups of the page it opened on. Left open
  across a page change, it no longer counts as editing whatever shares
  its item ids on the new page.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71539641-0b4b-471a-96e5-66632668ed31

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · 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

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

@greptile-apps

greptile-apps Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings could not be posted inline.

  • P2 Deferred dialog registration can capture the destination page ▶

    • Bug
      • When a page change precedes the dialog’s post-frame open callback, an item displayed by the old-page dialog contributes editing presence for the new page’s group if that page reuses its ID. The widget test establishes the callback ordering and outcome. Production navigation does not normally interleave a separate user action between a dialog build and its post-frame callback; this requires a page change already queued ahead of open in that frame. No production path producing that precise ordering was demonstrated.
    • Cause
      • open reads the current activePageId at callback time (lib/providers/collab/lineup_editing_presence_provider.dart:27), rather than receiving the page associated with the dialog when it was constructed.
    • Fix
      • Capture the dialog’s page ID when opening the dialog and pass it explicitly to open; do not infer ownership from the active page in the deferred callback.

@SunkenInTime
SunkenInTime merged commit 9c084e2 into t3code/unify-cloud-main Oct 3, 2026
14 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