Repository navigation
feat(native): make the deferred-link match rate measurable - #2831
Merged
Merged
Conversation
The restore path had no telemetry, and its clipboard catch swallowed the one distinction that matters: a declined iOS paste prompt and an organic install both end up as `raw === null`. A hand-off that never works would therefore look exactly like one nobody used, and the download modal (TASK-20769) is about to put real volume through it. Split the empty cases into distinct outcomes — clipboard_unavailable, no_handoff, marker_missing — and emit them with the channel alongside which fields actually came back. Only booleans and the channel are sent; the invite code, campaign tag and destination never leave the device (asserted in a test). Capture is fully guarded: this runs on first launch, where a telemetry failure must not cost the user their restored context. trackDeferredHandoffCreated is the seam for the modal to report the denominator — deliberately not fired inside playStoreUrlWithReferrer, which is a pure builder invoked on render and would count impressions.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
Contributor
Code-analysis diffPainscore total: 7451.65 → 7452.72 (+1.07) 🆕 New findings (10)
✅ Resolved (9)
📈 Painscore deltas (top movers)
|
Contributor
🧪 UI test report — ✅ all greenSuites
📊 Coverage (unit)
⏱ 10 slowest test cases
|
… match rate its denominator
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #2587 — re-authored onto
dev(the original branch predates the mobile-release retirement and is 800+ commits behind; force-push is blocked). One test in the original re-author was corrected: on Android a null install-referrer read is deliberately uncounted (transient failure — the one-shot survives for the next launch), so the organic-installno_handoffcase now asserts the iOS empty-clipboard path, and a new case pins the android retry semantics.Summary
Follow-up to #2560, stacked on
feat/deferred-deep-link-main. Adds the telemetry the deferred-link restore path is missing.feat/deferred-deep-link-main, so the diff shown includes #2560's commits until that merges. Retarget tomainonce #2560 lands — this branch's own change is 3 files / +157.Why
The restore path currently emits nothing, and the iOS clipboard
catch {}swallows the one distinction that matters:A declined paste prompt and an organic install both end up as
raw === null. So a hand-off that never works on iOS is indistinguishable from one nobody used — and the only signal either way is the absence of restores, which looks the same as success. The download modal (TASK-20769) is about to drive real volume through this, and the plan was always to measure the match rate before escalating to a blocking interstitial.What
DEFERRED_LINK_RESTORED, fired once per fresh install withchannel(referrer/clipboard/none) and one of four outcomes:restoredno_handoffmarker_missingpnutdl=1— organic Play referrer, or unrelated clipboard text that passed the URL gateclipboard_unavailableOn
restoredit also reportshas_dest/has_locale/has_invite/has_campaign.Plus
trackDeferredHandoffCreated(platform)as the seam for the modal to report the denominator. Deliberately not fired insideplayStoreUrlWithReferrer— that's a pure URL builder invoked on render, so it would count impressions as taps.Privacy
Only booleans and the channel leave the device. The invite code, campaign tag and destination never do — putting a user's inviter and intended screen into analytics would be a real regression. There's a test asserting the payload values are absent from the captured events.
Safety
posthog.captureis wrapped intry {} catch {}at both call sites. This runs on the first-launch path, where a telemetry failure must not cost the user their restored context — covered by a test that makes capture throw and asserts the restore still returns.Tests
4 added to the existing suite (25 pass total, including all 21 from #2560 unchanged):
marker_missing, notno_handofftsc --noEmitclean on the touched files; prettier clean.