Commit fde003c
committed
Don't reapply optimistic over canonical at trickle completion
The completion branch only consulted `arrival` to choose between discard
and apply. `arrival` is set by the accelerator, which no-ops when
`intervalID` is null — so two windows leak through:
1. Canonical lands during the 4s pre-trickle setTimeout. Accelerator runs
but returns early (intervalID still null), arrival never set, the
trickle runs full duration and merges the older optimistic payload on
top of the canonical at the same reportActionID. Server-added markup
(follow-up buttons, deep-link Pressables) gets clobbered until the
next server update.
2. Canonical hadn't landed yet by completion — same path.
Read persistedAction live from the trickleInputsRef at completion time
and take the discard path whenever it's defined, regardless of how it
got there. The visible trickle still runs to completion (start/complete
logs fire as expected).1 parent 21f3d5c commit fde003c
1 file changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
155 | 156 | | |
156 | 157 | | |
157 | 158 | | |
| |||
0 commit comments