Skip to content

1.9.0: accept react-native-get-random-values 2.x; CI checks the README install lines (draft) - #16

Merged
czypnt merged 6 commits into
release/1.9.0from
fix/1.9.0-peer-range
Nov 25, 2026
Merged

czypnt merged 6 commits into
release/1.9.0from
fix/1.9.0-peer-range

Conversation

@czypnt

@czypnt czypnt commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Fix for a defect found in the 1.9.0 release candidate (PR #15): the README install lines fail with a peer conflict.

The defect

1.9.0 makes react-native-get-random-values a peer with range ^1.8.0. Both README install lines install it unpinned. Today that is 2.1.0 (bare: npm latest; Expo SDK 58: bundledNativeModules.json has no entry, so expo install also takes latest). npm then reports ERESOLVE (an error, or "overriding peer dependency" when it is named in the same command). CI misses it: test installs with --legacy-peer-deps.

Fix

  • Peer range react-native-get-random-values: ^1.11.0 || ^2.0.0 (1.11 is the first bridgeless-aware 1.x; every README line and Expo SDK 52 to 58 resolves 1.11.0 or 2.1.0).
    • 2.0.0's one breaking change is "Switch to new architecture": minimum React Native 0.81 / Expo SDK 54 (its peer is react-native >=0.81). 2.1.0 adds Swift Package Manager support.
    • The SDK only imports the package for its side effect (it installs global.crypto.getRandomValues, used by uuid 11). 2.x does exactly that, same API.
    • 2.x needs the New Architecture too: 2.1.0's iOS module has only getTurboModule (no RCT_EXPORT_MODULE) and its JS calls TurboModuleRegistry.getEnforcing, so on 0.81 with the New Architecture off it installs cleanly and fails at start. README (bare and Expo) and CHANGELOG: below 0.81, or with the New Architecture off, install @^1.
    • 1.x stays accepted, so the SDK's react-native >=0.72 floor is unchanged. Expo SDK 52 to 57 pin ~1.11.0; SDK 58 takes 2.x.
  • AsyncStorage (no change): range ^1.17.0 || ^2.0.0. Latest is 3.1.1 (outside, multiRemove renamed); the bare line already pins @^2, and every Expo SDK 52 to 58 bundles 1.23.1 or 2.x.
  • Guard: new install-lines CI job (scripts/check-install-lines.mjs), no --legacy-peer-deps. It packs the SDK and resolves both README lines, exactly as written, in throwaway lockfile-only apps (react-native@latest; the @^1 advice on react-native@~0.80; expo@latest and expo@^52 with the versions expo install picks), logs the resolved versions,, failing on any ERESOLVE or invalid peer in npm ls. Also runs weekly, so a new major of an unpinned peer fails here first. No app build.
  • Bare steps (simulator rerun): npx install-expo-modules@latest, then npx expo install @datalyr/react-native expo-modules-core @react-native-async-storage/async-storage react-native-get-random-values, then pod install. The old plain npm install took expo-modules-core 58 on any React Native below 0.88, and pod install failed. README/CHANGELOG note the Expo SDK 54 AppDelegate line (bindReactNativeFactory(factory)) that install-expo-modules does not add.
  • expo-router is no longer an optional peer: npm checks an uninstalled optional peer against its newest version, and expo-router 58's expo-constants peer made the bare SDK 54 install fail with ERESOLVE (found by the guard; passes without it). The SDK loads it only inside useDatalyrScreenTracking.
  • The guard's bare cases now follow those steps for Expo SDK latest, 54 and 52, and fail on a second expo-modules-core copy. Not covered by a lockfile: pod install, native file edits, Gradle, autolinking.
  • Jest: tests pin the new range, the bare step order and the missing expo-router peer. CHANGELOG 1.9.0 updated.

Evidence

  • Commit 1 (guard only, old range): install-lines fails on both lines.

  • Commit 2 (range + README): install-lines passes.

  • Commit 3 (review fixes): all scenarios pass; resolved get-random-values 2.1.0 (RN 0.88.1, Expo 58), 1.11.0 (RN 0.80.3 with @^1; Expo 52 / RN 0.76.9).

  • Commit 5 (bare steps): six scenarios pass; bare SDK 54 resolves expo-modules-core 3.0.30, get-random-values 1.11.0.

Base is release/1.9.0 (PR #15's head), so the fix ships in 1.9.0. Draft: no merge, no publish.

🤖 Generated with Claude Code

czypnt and others added 6 commits November 24, 2026 23:16
Adds scripts/check-install-lines.mjs and a CI job (install-lines) that packs
the SDK and resolves the README's bare and Expo install lines in throwaway
lockfile-only apps (react-native@latest; expo@latest with the versions
expo install picks), failing on any ERESOLVE or invalid peer. Also runs weekly.

This commit adds the guard only, so it fails on the current
react-native-get-random-values peer range (^1.8.0; latest is 2.1.0).

Co-Authored-By: Claude Opus <noreply@anthropic.com>
The README install lines take get-random-values unpinned, which is 2.1.0
today (Expo SDK 58 bundles no version for it either), so the ^1.8.0 peer
range made both lines fail with ERESOLVE. 2.x's one breaking change is the
switch to the New Architecture (React Native 0.81+, Expo SDK 54+); the SDK
only imports it for its crypto.getRandomValues polyfill, unchanged in 2.x.
1.x stays accepted for apps on React Native below 0.81; the README says to
pin @^1 there. A jest test pins the range; CHANGELOG updated.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
…ines logs versions

- README (bare and Expo) and CHANGELOG: get-random-values 2.x works only on
  React Native 0.81+ with the New Architecture on; otherwise install @^1.
  2.1.0's iOS module has only getTurboModule (no RCT_EXPORT_MODULE) and its
  JS calls TurboModuleRegistry.getEnforcing, so with the New Architecture
  off it installs cleanly and then fails at start.
- CHANGELOG: drop the mention of the unpublished release candidate.
- Peer range ^1.11.0 || ^2.0.0 (1.11 is the first bridgeless-aware 1.x;
  the README lines and Expo SDK 52-58 all resolve 1.11.0 or 2.1.0).
- install-lines: logs the resolved react-native / expo / peers per scenario,
  and also checks the README's @^1 advice on react-native ~0.80 and the
  Expo line on expo ^52.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
Co-Authored-By: Claude Opus <noreply@anthropic.com>
…expo-router peer

- README bare steps: npx install-expo-modules@latest first (adds the Expo SDK
  that matches the app's React Native), then npx expo install for the SDK,
  expo-modules-core, AsyncStorage and get-random-values (SDK-matched), then
  pod install. The old npm install line took expo-modules-core 58 on any
  React Native below 0.88, and pod install failed.
- README/CHANGELOG: on Expo SDK 54, install-expo-modules does not add
  bindReactNativeFactory(factory) to AppDelegate.swift (the SDK 54 bare
  template has it; 55+ removed it); point to Expo's manual steps.
- package.json: expo-router is no longer an optional peer. npm checks an
  uninstalled optional peer against its newest version, and expo-router 58's
  expo-constants peer made the bare SDK 54 install fail with ERESOLVE (found
  by the guard). The SDK requires it only inside useDatalyrScreenTracking.
- install-lines: bare cases follow the new steps for Expo SDK latest/54/52
  (expo for the app's React Native, then the expo install line), fail on a
  second expo-modules-core copy, and state what a lockfile cannot cover
  (pod install, native edits, Gradle, autolinking). Jest tests updated.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
….x install wording

Expo's bare template calls bindReactNativeFactory for SDK 53 and 54 (not 52
or 55+), and expo 53/54's ExpoAppDelegate has the same fatalError. On React
Native below 0.81 npm refuses get-random-values 2.x (ERESOLVE); only with the
New Architecture off does 2.x install without a warning.

Co-Authored-By: Claude Opus <noreply@anthropic.com>
@czypnt
czypnt marked this pull request as ready for review November 25, 2026 06:17
@czypnt
czypnt merged commit 7ff5f5b into release/1.9.0 Nov 25, 2026
3 checks passed
czypnt added a commit that referenced this pull request Nov 25, 2026
… the publish yes) (#15)

* Release 1.9.0: version bump and changelog (no code change)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* 1.9.0: accept react-native-get-random-values 2.x; CI checks the README install lines (draft) (#16)

* CI: check the README install lines with strict peer rules

Adds scripts/check-install-lines.mjs and a CI job (install-lines) that packs
the SDK and resolves the README's bare and Expo install lines in throwaway
lockfile-only apps (react-native@latest; expo@latest with the versions
expo install picks), failing on any ERESOLVE or invalid peer. Also runs weekly.

This commit adds the guard only, so it fails on the current
react-native-get-random-values peer range (^1.8.0; latest is 2.1.0).

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* 1.9.0: accept react-native-get-random-values 2.x (peer ^1.8.0 || ^2.0.0)

The README install lines take get-random-values unpinned, which is 2.1.0
today (Expo SDK 58 bundles no version for it either), so the ^1.8.0 peer
range made both lines fail with ERESOLVE. 2.x's one breaking change is the
switch to the New Architecture (React Native 0.81+, Expo SDK 54+); the SDK
only imports it for its crypto.getRandomValues polyfill, unchanged in 2.x.
1.x stays accepted for apps on React Native below 0.81; the README says to
pin @^1 there. A jest test pins the range; CHANGELOG updated.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* 1.9.0 review fixes: New Architecture note, peer floor 1.11, install-lines logs versions

- README (bare and Expo) and CHANGELOG: get-random-values 2.x works only on
  React Native 0.81+ with the New Architecture on; otherwise install @^1.
  2.1.0's iOS module has only getTurboModule (no RCT_EXPORT_MODULE) and its
  JS calls TurboModuleRegistry.getEnforcing, so with the New Architecture
  off it installs cleanly and then fails at start.
- CHANGELOG: drop the mention of the unpublished release candidate.
- Peer range ^1.11.0 || ^2.0.0 (1.11 is the first bridgeless-aware 1.x;
  the README lines and Expo SDK 52-58 all resolve 1.11.0 or 2.1.0).
- install-lines: logs the resolved react-native / expo / peers per scenario,
  and also checks the README's @^1 advice on react-native ~0.80 and the
  Expo line on expo ^52.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* install-lines: tidy the header comment

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* 1.9.0: bare install via install-expo-modules then expo install; drop expo-router peer

- README bare steps: npx install-expo-modules@latest first (adds the Expo SDK
  that matches the app's React Native), then npx expo install for the SDK,
  expo-modules-core, AsyncStorage and get-random-values (SDK-matched), then
  pod install. The old npm install line took expo-modules-core 58 on any
  React Native below 0.88, and pod install failed.
- README/CHANGELOG: on Expo SDK 54, install-expo-modules does not add
  bindReactNativeFactory(factory) to AppDelegate.swift (the SDK 54 bare
  template has it; 55+ removed it); point to Expo's manual steps.
- package.json: expo-router is no longer an optional peer. npm checks an
  uninstalled optional peer against its newest version, and expo-router 58's
  expo-constants peer made the bare SDK 54 install fail with ERESOLVE (found
  by the guard). The SDK requires it only inside useDatalyrScreenTracking.
- install-lines: bare cases follow the new steps for Expo SDK latest/54/52
  (expo for the app's React Native, then the expo install line), fail on a
  second expo-modules-core copy, and state what a lockfile cannot cover
  (pod install, native edits, Gradle, autolinking). Jest tests updated.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* README/CHANGELOG: AppDelegate note covers Expo SDK 53 and 54; exact 2.x install wording

Expo's bare template calls bindReactNativeFactory for SDK 53 and 54 (not 52
or 55+), and expo 53/54's ExpoAppDelegate has the same fatalError. On React
Native below 0.81 npm refuses get-random-values 2.x (ERESOLVE); only with the
New Architecture off does 2.x install without a warning.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus <noreply@anthropic.com>

* 1.9.0: the Expo entry bundles without expo-router (guard the lazy require; draft) (#17)

* Test: the Expo entry must bundle without expo-router

Checks that every require('expo-router') in src/expo.ts (and the built
lib/expo.js) is inside a try block, which is what Metro's
allowOptionalDependencies needs, and that without expo-router the entry
loads and only useDatalyrScreenTracking fails, with a clear message.
This commit has the test only, so it fails on the current code.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* Expo entry: guard the lazy require('expo-router') so apps without it can bundle

Metro resolves every literal require at bundle time and treats one as
optional only inside a try block (allowOptionalDependencies, on in Metro's,
React Native's and Expo's default config). The unguarded require made an
Expo app without expo-router fail with 'Unable to resolve module expo-router'
(also in 1.8.0). Now only useDatalyrScreenTracking() needs expo-router, and
it throws a clear error without it. Reproduced with Metro alone (no React
Native): unguarded FAILED, guarded BUNDLED. CHANGELOG 1.9.0 Fixed.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus <noreply@anthropic.com>

* iOS: choose the tracking host from the live ATT status at send time (draft, do not merge before review) (#18)

* Tests: tracking host chosen from the live ATT status at send time (fail before the fix)

An event built with the IDFA while tracking was allowed and sent after it was turned
off goes to tracking.datalyr.com, which iOS blocks; the network error spends no retry
and the drain backs off, so every later event waits behind it.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* iOS: choose the tracking host from the live ATT status at send time

The host was chosen from the IDFA saved when the event was built. iOS blocks
tracking.datalyr.com (the privacy manifest's tracking domain) whenever tracking is
not authorized at send time, so an event queued while tracking was allowed and sent
after it was turned off failed as a network error, spent no retry, and held every
later event from the device.

- HttpClient.routeFor: tracking host only with an IDFA and live status 3; otherwise
  the normal host with idfa and alart removed (from a copy) and att_status /
  advertiser_tracking_enabled set to the status at send time.
- The status is read from the native module per IDFA send (iOS only; also refreshes
  the cache). Unknown is never authorized.
- EventQueue: two network failures in a row on the tracking host for one event ->
  also try the normal host without the IDFA, same eventId.
- Android: no provider, unchanged.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus <noreply@anthropic.com>

* iOS: tracking host only when ATT was authorized at process start (draft, do not merge before review) (#19)

* Tests: tracking host only when ATT was authorized at process start (fail before the fix)

iOS lifts its tracking-domain block only for app processes started after
tracking was allowed. These tests show the 1.9.0 candidate sends the first
launch's IDFA events to the blocked host, keeps a two-ever failure count,
and has no cool-down.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* iOS: use the tracking host only when ATT was authorized at process start

In the launch where the user allows tracking, iOS still blocks
tracking.datalyr.com. The status at process start is captured by the
native module at creation (OnCreate, process-wide) or, on an older native
binary, by the first JS read when the SDK loads; in memory only. Until the
next launch, authorized events go to ingest at once without the IDFA.
The next launch re-sends $att_status once with the IDFA. The two-failure
fallback count resets when the tracking host answers; after a fallback,
IDFA events skip the tracking host for 10 minutes. Android unchanged.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

* Review follow-ups: README ATT note, fixed re-send id, alart rule, HTTP-error fallback, more tests

- README: the advertising ID is sent from the launch after the user allows.
- $att_status re-send: fixed event id per grant (stored in the flag); the flag
  is removed only after the event is queued, so a kill can neither lose it
  nor count it twice.
- alart without an IDFA goes only to the tracking host (authorized at start
  and now); otherwise it is removed.
- A 4xx/5xx from the tracking host counts toward the two-failure fallback and
  the 10-minute skip; an attempt that did not use the tracking host resets it.
- Tests: upgrade (no re-send), flag cleared when not allowed, stored IDFA
  event in a launch not authorized at start, kill window, JS reload (new and
  old native), alart cell, HTTP 403/503 fallback, 2xx sent once.

Co-Authored-By: Claude Opus <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus <noreply@anthropic.com>

* Changelog: date line for 1.9.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* 1.9.0 changelog: tracking-host notes match the real-device finding (docs only) (#20)

* Changelog: 1.9.0 tracking-host notes match the real-device finding (docs only)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Changelog: say only what the device run showed about CocoaPods (review fix)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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