Skip to content

fix(social): drop a roster answer that lands after a newer one (#224) - #242

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:fix-224-roster-order
Oct 18, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
Birfy:fix-224-roster-order

Conversation

@Birfy

@Birfy Birfy commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

What was wrong

remoteBots() numbered roster fetches when their answer landed (rosterAt = ++rosterFetches after list_remote_bots returned). hideRemote starts a background remoteBots({ fresh: true }) after leaving rooms, so on a loaded machine (or a slow link) an older fetch could ask while the Bot was not shared, land after a newer fetch that already saw the re-share, take a newer number and overwrite remote — the re-shared Bot disappeared again. The newer caller returns the shared remote, which is exactly the intermittent #90: a hidden Bot shows again only after the owner re-shares it failure (#224, seen locally and once on CI in #225's run).

Second, smaller defect found on the way: the grant re-filter (syncOutgoingGrants().then(...)) re-applies the same server answer through applyRemoteRoster, and that counted as another absent fetch toward forgetting a local hide (HIDE_GONE_FETCHES = 2), so one absent answer could forget a hide.

What changed

Plugin-only, no core/ change, so no client build or patch regeneration.

Tests

Two new deterministic tests in plugins/social/test/social.test.js, both red at base (7a3ccb3, verified by stashing src/social.js) and green here:

  • #224: a roster answer that lands after a newer one is dropped… — holds one list_remote_bots reply (the server read the list when asked), lets a newer fetch see the re-share and land first, then releases the old one: at base the roster loses Coder again.
  • #224: the grant re-filter of one answer does not count as a second absent fetch — fast listGrants; at base absentFetches becomes 2 after one absent answer.

The existing #90 test is unchanged and now cannot hit the race.

Verification

TZ=UTC ARCH_DOCS_BASE=upstream/main npm run verify on this tip (Node 24.11.1, Linux): exit 0 — lint + arch-docs: OK (4 changed files), build-client check, patches check, core 790/0, social 184/0, tree 56/0, .github/scripts 78/0, interop and live-e2e lint+test pass.

Not run: smoke test (no core/ change), real-model bench.

Fixes #224

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T02:11:47.315818Z a1d14ff PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Birfy
Birfy added this pull request to the merge queue Oct 18, 2026
Merged via the queue into ThinkFlowLab:main with commit 9860863 Oct 18, 2026
7 checks passed
@Birfy
Birfy deleted the fix-224-roster-order branch October 18, 2026 02:08
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.

Flaky test: #90 hidden-Bot re-share fails intermittently on a loaded local machine

1 participant