Skip to content

Commit 03c1339

Browse files
committed
Tighten clobber-guard comment
Cuts the 5-line comment to 4 with the same load-bearing info — names the two arrival paths (`arrival` vs live ref read) and the symptom (clobbered server-added markup), drops the redundant "until the next server update" tail.
1 parent fde003c commit 03c1339

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/hooks/usePendingConciergeResponse.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,11 @@ function usePendingConciergeResponse(reportID: string | undefined) {
146146
arrivedAtElapsedMs: arrival?.elapsedMs,
147147
});
148148
dispatch('completed', snapshotTokens.at(-1) ?? snapshotHtml);
149-
// If the canonical reportComment is already in REPORT_ACTIONS at completion
150-
// time — whether acceleration fired or it landed during the pre-trickle
151-
// setTimeout (when accelerate runs but no-ops because intervalID is null) —
152-
// re-applying our older optimistic would clobber server-added markup
153-
// (follow-up buttons, deep-link Pressables) until the next server update.
154-
// Read live from the ref so we catch arrivals the accelerator missed.
149+
// Don't reapply our older optimistic when the canonical is already there —
150+
// it would clobber server-added markup (follow-up buttons, deep-link
151+
// Pressables). `arrival` covers the accelerator path; the live ref read
152+
// catches arrivals during the pre-trickle setTimeout where the accelerator
153+
// no-ops on null intervalID.
155154
if (arrival || trickleInputsRef.current.persistedAction) {
156155
discardPendingConciergeAction(reportID);
157156
} else {

0 commit comments

Comments
 (0)