Skip to content

[26.0] Ignore aborted requests in rethrowSimple#22325

Merged
mvdbeek merged 1 commit intogalaxyproject:release_26.0from
mvdbeek:fix-webhook-request-aborted
Apr 1, 2026
Merged

[26.0] Ignore aborted requests in rethrowSimple#22325
mvdbeek merged 1 commit intogalaxyproject:release_26.0from
mvdbeek:fix-webhook-request-aborted

Conversation

@mvdbeek
Copy link
Copy Markdown
Member

@mvdbeek mvdbeek commented Mar 31, 2026

When the browser aborts a request (e.g. during page navigation), silently return from rethrowSimple instead of throwing. No downstream consumer will handle the result when the page is being torn down.

Fixes GALAXY-MAIN-4KSCZZZ0014Z6 / #22324

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@github-actions github-actions Bot added this to the 26.1 milestone Mar 31, 2026
@mvdbeek mvdbeek force-pushed the fix-webhook-request-aborted branch from 773cc0b to 76dcc96 Compare March 31, 2026 13:03
When the browser aborts a request (e.g. during page navigation),
silently return from rethrowSimple instead of throwing. Carefully
distinguishes genuine aborts from timeouts: ECONNABORTED is only
swallowed when the message is exactly "Request aborted" (not a
timeout), and ERR_CANCELED is only swallowed when the message does
not mention "timeout".

Fixes GALAXY-MAIN-4KSCZZZ0014Z6
@mvdbeek mvdbeek force-pushed the fix-webhook-request-aborted branch from 76dcc96 to 28eb934 Compare March 31, 2026 13:04
@mvdbeek mvdbeek merged commit 25be26b into galaxyproject:release_26.0 Apr 1, 2026
29 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in Galaxy Dev - weeklies Apr 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

This PR was merged without a "kind/" label, please correct.

@nsoranzo nsoranzo deleted the fix-webhook-request-aborted branch April 1, 2026 08:42
@dannon
Copy link
Copy Markdown
Member

dannon commented Apr 1, 2026

This looks good and the intent makes sense, but Claude flagged something worth thinking about -- rethrowSimple returns never, and every caller in the codebase relies on that for control flow narrowing. The pattern everywhere is:

const { data, error } = await GalaxyApi().GET(...)
if (error) {
    rethrowSimple(error);
}
return data.map(...)  // TS knows data isn't undefined because rethrowSimple never returns

With the return undefined as never, if an abort happens, execution falls through and data is undefined, so you'd get a TypeError instead of the clean silent swallow. During full page teardown that's probably fine since nobody's around to care, but ERR_CANCELED also fires during SPA route changes when components unmount their AbortControllers -- where the app keeps running and that TypeError is arguably worse than the original error.

Might be better to handle this at a higher level so the never contract stays intact -- something like an isAbortedRequest check callers can use before calling rethrowSimple, or an interceptor that swallows aborts before they reach application code.

@mvdbeek mvdbeek mentioned this pull request Apr 6, 2026
@ahmedhamidawan ahmedhamidawan modified the milestones: 26.1, 26.0 Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

5 participants