Skip to content

Wait for persisted sender echo in the browser smoke test - #9

Open
nijaru wants to merge 1 commit into
basecamp:mainfrom
nijaru:browser-sender-echo-wait
Open

nijaru wants to merge 1 commit into
basecamp:mainfrom
nijaru:browser-sender-echo-wait

Conversation

@nijaru

@nijaru nijaru commented Oct 17, 2026

Copy link
Copy Markdown

The smoke flow sends three messages, waits for the text in the other tab, then asserts each tab has exactly three messages with data-message-id.

The sender's optimistic preview has no data-message-id; it gets one only when the persisted echo replaces it. Receiving the broadcast in the other tab does not imply that replacement has happened, so the sender tab can still show two persisted messages and fail intermittently.

This waits until each page has at least three persisted messages before the existing count assertion. The assertion is unchanged, so duplicates and missing messages still fail. If the echo never arrives, the wait itself times out rather than passing. Harness-only change: no server flow or coverage is altered.

Observed while verifying basecamp/once-campfire-go#12; a diagnostic rerun with this wait completed the full flow. That run did not capture the failed instant's count, so this does not independently prove the original failure's cause.

bin/check passes.

An optimistic preview has no data-message-id; receiving the broadcast in the
other tab does not mean the sender's echo has replaced it. Both tabs could be
counted while the third message was still a preview, failing the exact-three
check intermittently.

Wait until each page shows at least three persisted messages before counting.
The exact-three assertion is unchanged, so duplicates and missing messages
still fail; an echo that never arrives times out this wait. Harness-only
change; no server flow or coverage is altered.
Copilot AI balanced review requested due to automatic review settings October 17, 2026 11:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approved

The targeted wait addresses the timing race without weakening existing validation.

No open issues 🎉

What changed in this PR

Adds synchronization to the browser smoke test so it waits for persisted sender echoes before checking message counts.

Changes:

  • Waits for at least three persisted messages in each tab.
  • Preserves the exact-count assertion and existing coverage.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
browser/​smoke.mjs Waits for persisted messages before asserting counts.

Review effort: Balanced

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.

2 participants