Commit f8d9575
Drop redundant isRequestActive gate on in-flight correlation
`_operationExecutions` flips to `'inactive'` while `_state === 'loading_final'`
(with no pending module payloads) — before the network stream completes and
`_inFlightOperationCompletions` is cleared in `cancel()`. Under incremental
delivery, fragments reading during that "final-but-not-complete" window fall
through to partial-data reads instead of suspending on the still-valid
completion promise, defeating this correlation. Gate solely on the completion
map entry's presence (via `getPromiseForInFlightOperation`) — populated in the
Executor constructor and cleared atomically when `_complete` fires — which
IS the correct in-flight signal for this branch.
Adds a test in useFragment-WithOperationTrackerSuspense-test.js exercising the
mid-stream window where isRequestActive returns false while the completion
promise is still valid; the fragment must suspend on that promise.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 26de1b0 commit f8d9575
2 files changed
Lines changed: 57 additions & 2 deletions
File tree
- packages
- react-relay/relay-hooks/__tests__
- relay-runtime/util
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
548 | 604 | | |
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
| |||
0 commit comments