Commit 59e0111
committed
Stop flowing and then abort if a stream is cancelled (#27405)
We currently abort a stream either it's explicitly told to abort (e.g.
by an abortsignal). In this case we still finish writing what we have as
well as instructions for the client about what happened so it can
trigger fallback cases and log appropriately.
We also abort a request if the stream itself cancels. E.g. if you can't
write anymore. In this case we should not write anything to the outgoing
stream since it's supposed to be closed already now. However, we should
still abort the request so that more work isn't performed and so that we
can log the reason for it to the onError callback.
We should also not do any work after aborting.
There we need to stop the "flow" of bytes - so I call stopFlowing in the
cancel case before aborting.
The tests were testing this case but we had changed the implementation
to only start flowing at initial read (pull) instead of start like we
used to. As a result, it was no longer covering this case. We have to
call reader.read() in the tests to start the flow so that we need to
cancel it.
We also were missing a final assertion on the error logs and since we
were tracking them explicitly the extra error was silenced.
DiffTrain build for commit d9e00f7.1 parent 04fa1ae commit 59e0111
File tree
7 files changed
+9
-9
lines changed- compiled-rn/facebook-fbsource/xplat/js
- RKJSModules/vendor
- react-test-renderer/cjs
- react/cjs
- react-native-github/Libraries/Renderer
7 files changed
+9
-9
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23998 | 23998 | | |
23999 | 23999 | | |
24000 | 24000 | | |
24001 | | - | |
| 24001 | + | |
24002 | 24002 | | |
24003 | 24003 | | |
24004 | 24004 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8620 | 8620 | | |
8621 | 8621 | | |
8622 | 8622 | | |
8623 | | - | |
| 8623 | + | |
8624 | 8624 | | |
8625 | 8625 | | |
8626 | 8626 | | |
| |||
8651 | 8651 | | |
8652 | 8652 | | |
8653 | 8653 | | |
8654 | | - | |
| 8654 | + | |
8655 | 8655 | | |
8656 | 8656 | | |
8657 | 8657 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9046 | 9046 | | |
9047 | 9047 | | |
9048 | 9048 | | |
9049 | | - | |
| 9049 | + | |
9050 | 9050 | | |
9051 | 9051 | | |
9052 | 9052 | | |
| |||
9077 | 9077 | | |
9078 | 9078 | | |
9079 | 9079 | | |
9080 | | - | |
| 9080 | + | |
9081 | 9081 | | |
9082 | 9082 | | |
9083 | 9083 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
619 | | - | |
| 619 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
| 622 | + | |
623 | 623 | | |
624 | 624 | | |
625 | 625 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
0 commit comments