You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix three issues found reviewing the 1.0.1 lifecycle work (#73)
* 1.0.1
* Fix three issues found reviewing the 1.0.1 lifecycle work
1. CrashReporter could sever the handler chain. The installed handler read
`this.previousHandler`, which cleanup() cleared. With two reporters — the
provider re-initialising, or a customer's own reporter wrapping ours — the
sequence A.start, B.start, A.cleanup, crash left B forwarding into A, and A
forwarding into `undefined`: the real RN/default handler never ran, and A
reported a duplicate despite being stopped. The previous handler is now
captured in the closure at install time, cleanup no longer clears it, and a
stopped reporter forwards without reporting.
2. buildScreenUrl let the screen name change the URL's structure.
screen("Checkout?coupon=X") parsed with pathname "/Checkout" and the rest
silently dropped. '?' and '#' are now percent-encoded; '/' deliberately is
not, since router-style names are meant to be path segments.
Dot segments are knowingly left alone: the URL spec decodes %2E before
resolving path segments, so JS collapses "a/../Admin" either way — and it
does not matter, because the pipeline parses with ClickHouse's path(), which
performs no dot-segment normalisation. Verified against the real parser.
3. Deep Link Opened was gated on attribution.deeplinks rather than its own
autocapture flag, because that check also guarded the Linking hook both
features share. Turning attribution off silently disabled the event with no
indication an unrelated setting was responsible. The hook is now installed
if either consumer needs it, and each behaviour checks its own flag.
297 tests (6 new), typecheck, lint and build clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Escape '%' before encoding URL delimiters, keeping screen names distinct
Review follow-up. Encoding '?' as %3F without first escaping '%' made the
transform non-injective: a screen literally named "Checkout%3Fx" and one named
"Checkout?x" both produced ".../Checkout%3Fx", silently merging two distinct
screens in the analytics.
'%' is now encoded first, so "Checkout?x" -> "Checkout%3Fx" and
"Checkout%3Fx" -> "Checkout%253Fx". Test asserts a mixed set of names maps to
the same number of distinct URLs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments