Repository navigation
Conversation
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.
There was a problem hiding this comment.
🟢 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 rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
| browser/smoke.mjs | Waits for persisted messages before asserting counts. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/checkpasses.