Commit ebb5ebc
test(raw): pin the drop-and-instantly-re-add case, and fix two comment drifts
Review found the drop-cancellation implementation correct but the test
surface incomplete: no test exercised re-adding a frame in the same turn it
was dropped, which is the only way to observe `forget`'s identity check and
`dropRawConversions`'s eager `forget` actually doing their jobs -- the
existing "forgets a frame dropped before it started" test awaits the
rejection first, giving the ordinary catch -> forget path time to clean up
before the re-add ever runs.
Adds one test that drops and re-adds with no await between, confirmed by
mutation to fail both ways: deleting `dropRawConversions`'s `forget` call
lets the re-added promise inherit the dropped entry's AbortError, and
reverting `forget`'s identity check lets the dropped entry's late,
post-rejection forget delete the re-added entry's cache slot, surfacing as a
third conversion of bytes already held.
Also corrects two doc comments that had drifted from the code they describe:
`tiffFor`'s claim that a converter skipping `onStart` leaves frames
droppable "for their whole life" (false since the `started || done`
widening -- droppable only until they finish), and `dropRawConversions`'s
docstring naming the test fixture `countingIo` where it should state the
underlying contract instead.
Refs #248
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 645e432 commit ebb5ebc
2 files changed
Lines changed: 45 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
236 | 273 | | |
237 | 274 | | |
238 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
276 | 278 | | |
277 | 279 | | |
278 | 280 | | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
283 | 286 | | |
284 | 287 | | |
285 | 288 | | |
| |||
0 commit comments