Skip to content

Hermes symbolication fixes + Expo/EAS source maps guide - #756

Merged
unjica merged 2 commits into
developfrom
codex/hermes-sourcemaps
Oct 11, 2026
Merged

unjica merged 2 commits into
developfrom
codex/hermes-sourcemaps

Conversation

@unjica

@unjica unjica commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Hermes frames such as at r (address at index.android.bundle:1:165) previously retained address at in the filename and could not find uploaded maps. They now resolve to the fixture throw site checkout.js:7:14 and its original call sites. Native scheme filenames and iOS absolute paths also match; HTTP-to-HTTP matching keeps host/path checks.

React Native now chains its previous global handler, attempts fatal error delivery for at most one second, installs once per ErrorUtils instance, and defaults platform to react-native while preserving explicit overrides. Core error-object deduplication prevents duplicate manual/global reports. Eight RN tests cover this behavior, including a test with the actual core SDK.

OTA design: buildBundleRelease(nativeVersion, bundleId) validates and encodes bundle identity. Require a distinct release per JS bundle and separate app labels per platform, since artifacts are not platform-keyed. Match verified device sourceURL/path (or its basename); no single-artifact fallback for unknown OTA hashes and no cross-release fallback. Reject multiple matches and conservatively refuse releases at the 128-ref metadata cap. Release uniqueness cannot be inferred or guaranteed by the server; the guide states the operational requirement.

Function-name decision: retain existing labels, as explicitly permitted by the task when a reliable correction cannot be confirmed. Tests show originalPositionFor returns the callee token computeTotal at an onPressPay call site in both the Hermes composed map and the web packager map. Sentry uses scope information and caller-name heuristics, rather than blindly assigning each token name or shifting all names by one frame (implementation). A universally safe enclosing-name recovery was not established for TT's map-only pipeline. This remaining limitation is documented.

Guide: docs/expo-hermes-source-maps.md, linked from SDK React Native docs, /docs/react-native, and /error-tracking/react-native. Covers SDK setup and identity convention, Android/iOS EAS Build maps and iOS SOURCEMAP_FILE, Expo Update exports and conditional Hermes composition, JSON API upload, an EAS success hook and existing GitHub Action, and runtime bundle URLs. Limits: JS errors only/no native crash capture, 10 MiB map JSON limit, no debug IDs, no automatic EAS integration, function-name limitations and best-effort fatal delivery. No claim of full Expo support. The action's existing .map filename fallback suffices for the staged maps; no extension change was needed.

Validation:

  • pnpm install --frozen-lockfile: passed after adding the RN test dependency to the lockfile.
  • pnpm lint: passed, zero warnings.
  • pnpm test: 1,435 passed, 128 DB-gated tests skipped, zero failures. API 1,060; dashboard 227; core 67; vite-plugin 14; node 27; next 15; RN 8; publish guards 17.
  • Targeted symbolicator: 31 passed, including real Hermes CLI stack/composed-map throw and call positions, native URL variants, ambiguous maps, metadata cap, OTA paths, and web V8/Firefox regressions. Newer Hermes map composed with metro-source-map 0.87.1 resolves the throw using its own synthetic absolute offset (131); this is not a newly executed real device/CLI stack.
  • pnpm build: passed for all workspace packages including Next production build.
  • Production API tsc -p tsconfig.build.json --noEmit and RN tsc --noEmit: passed.
  • Broad API tsc --noEmit: 106 existing test-file errors, identical error multiset with the original API test file (line numbers normalized); no new errors. Dashboard broad tsc --noEmit: six existing errors in unchanged google-analytics.test.ts and marketing-seo-head.test.ts. Production build type validation passes.
  • DB integration attempt: local PostgreSQL initdb failed because sandbox disallowed shared-memory creation; no production database used. CI must run its PostgreSQL-enabled suite after publication.
  • Self-review: git diff origin/develop..., full working diff/new files, git status, and git diff --check. HEAD and origin/develop are both 51e1d9d; the local develop ref is stale, so origin/develop was used for comparison. Generated build changes are excluded/restored, as required by the handoff.

CI/publication: pending runner publication. No git-state writes, PR writes, merge, deployment, package publication or EAS update publication performed. No existing branch PR was found with gh pr list --head codex/hermes-sourcemaps --state all. The runner should open one normal PR against develop and attach its URL; hosted CI/review cannot start before that step.

UNVERIFIED QA (must be checked on supported Expo/RN versions):

  • Real Android release Hermes sourceURL strings and map offsets.
  • Real iOS release sourceURL strings, SOURCEMAP_FILE output and map offsets.
  • expo-updates OTA device paths and upload identity alignment (including embedded fallback/rollback).
  • Actual composed-map JSON sizes against the 10 MiB cap.
  • Live upload with a project key enabled for source-map upload.
  • Dashboard end-to-end raw/symbolicated display for embedded and OTA bundles.
  • Real RN fatal crash/red-box behavior and best-effort delivery on device.
  • Hosted CI including PostgreSQL integration tests and normal review flow.

unjica and others added 2 commits October 9, 2026 18:55
Normalize Hermes addresses and native bundle paths, reject ambiguous maps,
and cover real composed maps plus the newer Hermes map layout.
Chain React Native global handlers with bounded fatal delivery, default
platform, and add a bundle-specific release helper and Expo/EAS guide.
@unjica
unjica merged commit c27cd6e into develop Oct 11, 2026
7 checks passed
This was referenced Oct 11, 2026
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