Skip to content

fix(mobile): give React Native's AbortSignal throwIfAborted - #775

Merged
Medformatik merged 1 commit into
mainfrom
fix/mobile-abortsignal-throwifaborted
Nov 4, 2026
Merged

Medformatik merged 1 commit into
mainfrom
fix/mobile-abortsignal-throwifaborted

Conversation

@Medformatik

@Medformatik Medformatik commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Requests from the installed app through the shared API client fail with TypeError: undefined is not a function. Since #585 the client calls signal.throwIfAborted() after reading a response, and React Native's AbortSignal has no such method. On Android this breaks every directions, native reroute and transit refresh request the shell makes itself (GroundRerouteService, TransitRefreshService); requests made by the website inside the WebView are unaffected.

The app now installs AbortSignal.prototype.throwIfAborted at startup, before any other module runs, the same way it already installs crypto.getRandomValues. It throws the signal's reason, or an AbortError when there is none, and leaves an existing implementation alone.

Verification

  • Found on the Pixel (Android 17) while testing Android Auto: car route planning uses the same fetchDirections client, and the device log showed the TypeError at the controller.signal.throwIfAborted() line of packages/core/src/api/client.ts. With this polyfill the same request returned routes.
  • Mobile Jest 68 suites / 1,297 tests (including the new polyfill tests), tsc --noEmit, Biome.
  • Not verified on device: a native reroute on a real trip with this exact build.

Release and upgrade impact

No package release: app-only change in apps/mobile. It takes effect with the next app build.

The shared API client calls signal.throwIfAborted() after reading a response. React Native's AbortSignal has no such method, so every directions, reroute and transit refresh request from the installed app failed with "undefined is not a function".
@Medformatik
Medformatik enabled auto-merge (squash) November 4, 2026 18:41
@Medformatik
Medformatik merged commit 94659ca into main Nov 4, 2026
27 of 40 checks passed
@Medformatik
Medformatik deleted the fix/mobile-abortsignal-throwifaborted branch November 4, 2026 18:51
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant