Commit d483706
committed
fix(assets): defer a loadMore started while a refresh is in flight
Splitting the shared in-flight guard fixed a refresh being swallowed by a
pending loadMore, but it also dropped the protection the shared guard gave
in the other direction. On main a loadMore issued while a refresh was
pending returned the refresh's promise and did nothing. It now issues a
real request, and because the refresh has already rewound the offset and
cursor to the head, that request re-fetches the first page. Every id
dedupes against the just-refreshed seenIds, so `fresh` is empty and
`flatOutputHasMore` is stranded at false, dead-ending pagination even
though the server reported more pages.
The epoch guard does not catch this: the loadMore captures the epoch after
the refresh has already incremented it, so the two match on settle.
Defer to the in-flight refresh instead, mirroring the branch directly above
that defers to an in-flight loadMore.
Not reachable through the one current consumer, which gates loadMore on
`!loading`, but the store should not depend on callers for this.1 parent a1279be commit d483706
2 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2511 | 2511 | | |
2512 | 2512 | | |
2513 | 2513 | | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
2514 | 2541 | | |
2515 | 2542 | | |
2516 | 2543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
332 | 340 | | |
333 | 341 | | |
334 | 342 | | |
| |||
0 commit comments