Cancel running fetch requests when PDF export fails or is cancelled.#12848
Open
shervElmi wants to merge 9 commits into
Open
Cancel running fetch requests when PDF export fails or is cancelled.#12848shervElmi wants to merge 9 commits into
shervElmi wants to merge 9 commits into
Conversation
🎭 Playwright reports for 3d10af5: 📚 Storybook for 3d10af5: 📦 Build files for 3d10af5:
|
The generated fetchX action now takes an optional trailing options
object, such as { signal }, and hands it to controlCallback as a
second argument. The object stays out of argsToParams and the error
key, so the isFetching flag and the fetch reducers key the request the
same way with or without it.
The control callback now reads a signal from its second argument and forwards it to the get helper, so the Analytics report request aborts when the PDF export is cancelled or fails.
The control callback now reads a signal from its second argument and forwards it to the get helper, so the Search Console report request aborts when the PDF export is cancelled or fails.
The control callback now reads a signal from its second argument and forwards it to the get helper, so the AdSense report request aborts when the PDF export is cancelled or fails.
The control callback now reads a signal from its second argument and forwards it to the get helper, so the PageSpeed Insights report request aborts when the PDF export is cancelled or fails.
The catch path now calls abort() on the export's AbortController before it transitions to ERROR, so a request still in flight stops instead of finishing in the background after the user sees the error. The cancel and stage-timeout paths already abort, so this only covers the other transitions into ERROR.
13da1f8 to
c82d67b
Compare
|
Size Change: 0 B Total Size: 2.89 MB ℹ️ View Unchanged
|
This change introduces a helper function to cleanly separate fetch
options, such as `{ signal }`, from the rest of the arguments passed
to the `fetchX` actions. This ensures that the parameters and fetch
options remain distinct, improving code maintainability and readability.
Revised comments in the PDF export orchestrator and related tests to enhance clarity. Updated test descriptions to reflect the changes in fetch options terminology.
This change improves the readability of the code by formatting the assignment of fetch options across multiple lines. It enhances maintainability and aligns with the project's coding standards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist