Skip to content

Cancel running fetch requests when PDF export fails or is cancelled.#12848

Open
shervElmi wants to merge 9 commits into
developfrom
enhancement/12699-forward-fetch-abort-signal
Open

Cancel running fetch requests when PDF export fails or is cancelled.#12848
shervElmi wants to merge 9 commits into
developfrom
enhancement/12699-forward-fetch-abort-signal

Conversation

@shervElmi
Copy link
Copy Markdown
Collaborator

@shervElmi shervElmi commented Jun 5, 2026

Summary

Addresses issue:

Relevant technical choices

  • Implementation follows the IB without deviations.

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 7.4.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.
  • Ensure there are no unexpected significant changes to file sizes.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

🤖 This comment is automatically updated by CI workflows. Each section is managed independently.

🎭 Playwright reports for 3d10af5:

📚 Storybook for 3d10af5:

📦 Build files for 3d10af5:

@shervElmi shervElmi marked this pull request as ready for review June 5, 2026 14:09
shervElmi added 6 commits June 5, 2026 21:20
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.
@shervElmi shervElmi force-pushed the enhancement/12699-forward-fetch-abort-signal branch from 13da1f8 to c82d67b Compare June 5, 2026 18:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

Size Change: 0 B

Total Size: 2.89 MB

ℹ️ View Unchanged
Filename Size Change
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.css 124 B 0 B
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/block-editor-plugin/index.js 42.7 kB 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.css 307 B 0 B
dist/assets/blocks/reader-revenue-manager/common/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/reader-revenue-manager/contribute-with-google/index.js 5.8 kB 0 B
dist/assets/blocks/reader-revenue-manager/contribute-with-google/non-site-kit-user.js 5.01 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/index.js 5.81 kB 0 B
dist/assets/blocks/reader-revenue-manager/subscribe-with-google/non-site-kit-user.js 5 kB 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.css 84 B 0 B
dist/assets/blocks/sign-in-with-google/editor-styles.js 0 B 0 B 🆕
dist/assets/blocks/sign-in-with-google/index.js 18.5 kB 0 B
dist/assets/css/googlesitekit-admin-css-********************.min.css 70.9 kB 0 B
dist/assets/css/googlesitekit-adminbar-css-********************.min.css 12.3 kB 0 B
dist/assets/css/googlesitekit-authorize-application-css-********************.min.css 851 B 0 B
dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 8.9 kB 0 B
dist/assets/js/146-********************.js 960 B 0 B
dist/assets/js/201-********************.js 2.85 kB 0 B
dist/assets/js/273-********************.js 52.5 kB 0 B
dist/assets/js/314-********************.js 100 kB 0 B
dist/assets/js/315-********************.js 3.08 kB 0 B
dist/assets/js/379-********************.js 3.7 kB 0 B
dist/assets/js/397-********************.js 477 kB 0 B
dist/assets/js/590-********************.js 1.88 kB 0 B
dist/assets/js/640-********************.js 2.35 kB 0 B
dist/assets/js/909-********************.js 1.01 kB 0 B
dist/assets/js/analytics-advanced-tracking-********************.js 404 B 0 B
dist/assets/js/googlesitekit-activation-********************.js 24.9 kB 0 B
dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 60.8 kB 0 B
dist/assets/js/googlesitekit-admin-pointers-tracking-********************.js 5.36 kB 0 B
dist/assets/js/googlesitekit-adminbar-********************.js 36.1 kB 0 B
dist/assets/js/googlesitekit-api-********************.js 8.03 kB 0 B
dist/assets/js/googlesitekit-block-tracking-********************.js 5.56 kB 0 B
dist/assets/js/googlesitekit-components-********************.js 5.63 kB 0 B
dist/assets/js/googlesitekit-consent-mode-********************.js 26 kB 0 B
dist/assets/js/googlesitekit-data-********************.js 1.76 kB 0 B
dist/assets/js/googlesitekit-datastore-forms-********************.js 7.2 kB 0 B
dist/assets/js/googlesitekit-datastore-location-********************.js 1.52 kB 0 B
dist/assets/js/googlesitekit-datastore-pdf-********************.js 1.19 kB 0 B
dist/assets/js/googlesitekit-datastore-site-********************.js 18.9 kB +72 B (+0.38%)
dist/assets/js/googlesitekit-datastore-ui-********************.js 7.36 kB 0 B
dist/assets/js/googlesitekit-datastore-user-********************.js 23.4 kB +75 B (+0.32%)
dist/assets/js/googlesitekit-entity-dashboard-********************.js 74.2 kB 0 B
dist/assets/js/googlesitekit-events-provider-contact-form-7-********************.js 2.35 kB 0 B
dist/assets/js/googlesitekit-events-provider-easy-digital-downloads-********************.js 1.12 kB 0 B
dist/assets/js/googlesitekit-events-provider-mailchimp-********************.js 2.34 kB 0 B
dist/assets/js/googlesitekit-events-provider-ninja-forms-********************.js 2.3 kB 0 B
dist/assets/js/googlesitekit-events-provider-optin-monster-********************.js 2.22 kB 0 B
dist/assets/js/googlesitekit-events-provider-popup-maker-********************.js 2.44 kB 0 B
dist/assets/js/googlesitekit-events-provider-woocommerce-********************.js 1.08 kB 0 B
dist/assets/js/googlesitekit-events-provider-wpforms-********************.js 2.44 kB 0 B
dist/assets/js/googlesitekit-i18n-********************.js 4.43 kB 0 B
dist/assets/js/googlesitekit-key-metrics-setup-********************.js 54.1 kB 0 B
dist/assets/js/googlesitekit-main-dashboard-********************.js 177 kB 0 B
dist/assets/js/googlesitekit-metric-selection-********************.js 60 kB 0 B
dist/assets/js/googlesitekit-modules-********************.js 26 kB +92 B (+0.35%)
dist/assets/js/googlesitekit-modules-ads-********************.js 47 kB +79 B (+0.17%)
dist/assets/js/googlesitekit-modules-adsense-********************.js 138 kB +82 B (+0.06%)
dist/assets/js/googlesitekit-modules-analytics-4-********************.js 205 kB +97 B (+0.05%)
dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 23.4 kB +84 B (+0.36%)
dist/assets/js/googlesitekit-modules-reader-revenue-manager-********************.js 52.8 kB +84 B (+0.16%)
dist/assets/js/googlesitekit-modules-search-console-********************.js 65.6 kB +85 B (+0.13%)
dist/assets/js/googlesitekit-modules-sign-in-with-google-********************.js 33.8 kB +73 B (+0.22%)
dist/assets/js/googlesitekit-modules-tagmanager-********************.js 30.4 kB +77 B (+0.25%)
dist/assets/js/googlesitekit-notifications-********************.js 67.8 kB 0 B
dist/assets/js/googlesitekit-polyfills-********************.js 228 B 0 B
dist/assets/js/googlesitekit-settings-********************.js 136 kB 0 B
dist/assets/js/googlesitekit-splash-********************.js 80.8 kB 0 B
dist/assets/js/googlesitekit-user-input-********************.js 52.5 kB 0 B
dist/assets/js/googlesitekit-vendor-********************.js 314 kB 0 B
dist/assets/js/googlesitekit-vendor-lazy-pdf-********************.js 3.06 kB +6 B (+0.2%)
dist/assets/js/googlesitekit-widgets-********************.js 104 kB 0 B
dist/assets/js/googlesitekit-wp-dashboard-********************.js 62 kB 0 B
dist/assets/js/runtime-********************.js 1.95 kB 0 B

compressed-size-action

shervElmi added 3 commits June 5, 2026 22:56
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant