Skip to content

fix: runtime crashes on bundled deploy (fetch binding + signal serialization) — 2.4.0#2

Merged
OrFrederick merged 3 commits into
mainfrom
fix/runtime-binding-and-signal
Jun 17, 2026
Merged

fix: runtime crashes on bundled deploy (fetch binding + signal serialization) — 2.4.0#2
OrFrederick merged 3 commits into
mainfrom
fix/runtime-binding-and-signal

Conversation

@OrFrederick

Copy link
Copy Markdown
Contributor

Summary

Fixes two runtime bugs that crash the add-in on deploy/login (minified prod builds). Release 2.4.0. Runtime-only — no src/types/** changes.

1. TypeError: Illegal invocation on first API call (src/internal/call.ts)

Minified bundles emit module.fetch(url), calling native fetch with this=module. Fix: fetch.call(globalThis, url, …). Matches the patch already proven in production in a sibling app.

2. signal serialized into ExecuteMultiCall (src/internal/queue.ts)

The multicall batcher copied whole queue entries (incl. AbortSignal{}, plus resolve/reject) into the JSON-RPC payload. Fix: send only { method, params } per call.

Tests

  • TDD red→green for both fixes; full suite 37/37 (pnpm test).
  • Built bundles verified: .call(globalThis present and calls.map(...) projection in both dist/index.js + dist/esm/index.js.

Review

Independent code review: no issues at/above threshold. Abort handling + result dispatch confirmed intact (original calls array untouched); params-omission is strictly cleaner; fetch.call(globalThis) correct on both node-ponyfill and browser paths.

Consumer follow-ups (separate, after publish)

  • ecoapp-web: drop patches/@fairfleet__geotab@2.3.0.patch + omitSignalFromSerializedCalls middleware; bump to ^2.4.0.
  • ecoapp-addin-dev: bump to ^2.4.0, then migrate to prod.

@OrFrederick OrFrederick merged commit 90ea5f0 into main Jun 17, 2026
1 check passed
@OrFrederick OrFrederick deleted the fix/runtime-binding-and-signal branch June 17, 2026 17:48
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