Skip to content

Update React Native example to @formo/analytics-react-native 1.1.0 - #134

Merged
yosriady merged 1 commit into
mainfrom
chore/rn-sdk-1.1.0
Aug 10, 2026
Merged

Update React Native example to @formo/analytics-react-native 1.1.0#134
yosriady merged 1 commit into
mainfrom
chore/rn-sdk-1.1.0

Conversation

@yosriady

@yosriady yosriady commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Bumps the React Native example from ^1.0.2 to ^1.1.0, picking up sdk-react-native#83.

package.json + pnpm-lock.yaml only — no app code changes are needed, since 1.1.0 has no API, type, export or dependency changes.

What the example gains

  • Traffic-source sanitization. utm_*/ref/referrer captured from deep links and the Android Play install referrer were previously stored and replayed onto every event with no validation.
  • Cold-start attribution. The first event of an app session now ships immediately rather than waiting for flushAt or the 30s timer — exactly the events lost to a force-quit or OS memory kill.
  • Queue and teardown reliability. Failed flushes re-arm the retry interval instead of stranding events; permanently-rejected batches are dropped rather than re-posted forever; teardown is bounded and idempotent and can no longer hang SDK re-initialization.

Verification

Ran against the published package, with the example under Metro and events pointed at a local collector so the exact wire payloads could be asserted on rather than inferred:

Check Result
Clean marketing link all six utm_*/ref values intact — no false positives
library_version on the wire 1.1.0
Cold-start batching first batch carries exactly 1 event, then batches of 2–3
Poisoned deep link double-encoded, scheme-in-value, multi-byte and raw-markup payloads all dropped; clean utm_medium/utm_content alongside them survived; referrer dropped
UI-driven events 3 clicks → batches of 3 and 2, not one request per click
Collector rejecting everything batches dropped once, not re-posted on a loop; no Uncaught (in promise) in a clean console
Teardown 3 × unmount → cleanup → re-init, each re-initializing and delivering

pnpm install --frozen-lockfile, pnpm typecheck and the example's 14 tests all pass.

Notes for the reviewer

  • The apiHost override used to point events at the local collector was test-only and is not in this diff — the change is strictly the two dependency files.
  • pnpm lint fails in this example on a missing ESLint config. That is pre-existing (it fails identically on unmodified main) and CI runs typecheck for with-react-native, not lint — so it is out of scope here.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Review in cubic

Picks up getformo/sdk-react-native#83: traffic-source sanitization for
values captured from deep links and the Android install referrer,
immediate delivery of the first event of an app session, and a batch of
queue and teardown reliability fixes.

No app code changes are needed — 1.1.0 has no API, type or export changes.

Verified against the published package end to end, with the example running
under Metro and events pointed at a local collector:

  - a clean marketing link keeps all six utm_*/ref values, no false
    positives, and events report library_version 1.1.0
  - the first batch on the wire carries exactly one event, so cold-start
    attribution is not held for the batch timer
  - double-encoded, scheme-in-value, multi-byte and raw-markup payloads in
    a deep link are all dropped, while clean values alongside them survive
  - UI-driven events batch rather than sending one request per interaction
  - against a collector rejecting every request, batches are dropped once
    rather than re-posted forever, and no unhandled rejection reaches the app
  - three unmount -> cleanup -> re-init cycles each re-initialize and deliver

`pnpm install --frozen-lockfile`, `pnpm typecheck` and the example's tests
all pass.

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

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

@yosriady
yosriady merged commit 2868a56 into main Aug 10, 2026
8 checks passed
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