Repository navigation
fix(dashpay): share invite links the iOS wallet can open (#1586) - #1587
Conversation
The iOS wallet has no AppsFlyer SDK: it only opens an invitation when the `dashpay://invite` payload rides in the URL as `af_dp`, and only from a domain it claims (dashpay.onelink.me / dashpaytest.onelink.me). Three things on the Android side broke that: - The shared link was whatever AppsFlyer returned. A successful shortlink request yields a short OneLink with no `af_dp`, which iOS cannot resolve; iOS compatibility so far depended on that request failing. The shared link is now always the SDK's long link; the server answer is kept in `Invitation.dynamicLink` for reference. - When the app id is not part of the OneLink template (the _testNet3 package is not in k7Pz), the SDK never learns the template domain and falls back to go.onelink.me, whose AASA does not list the Dash app. InviteShareLink puts the build's brand domain back and adds the trailing slash so the path matches the AASA pattern `/<template>/*`. - `avatar-url` was percent-encoded twice (URLEncoder + Uri.Builder). The platform SDK parser used by iOS decodes once and got a broken avatar URL. The link now encodes it once; reading keeps decoding legacy links. Also sets `deep_link_value` alongside `af_dp`, the field AppsFlyer Unified Deep Linking hands to a freshly installed app. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe invitation flow now handles encoded avatar URLs and normalizes eligible AppsFlyer OneLinks. It stores the share link with the invitation and reads it from the saved invitation for sharing and copying. ChangesInvitation links and sharing
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Invitations share the iOS-compatible long link stored with the invitation. The earlier concern about oversized background-task output is addressed. No merge-blocking issues remain, though the iOS tap test is still pending QA. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The changed sharing path uses configured wallet domains and preserves the invitation payload without changing the inspected validation checks. No introduced security defect was established, but third-party deferred-link delivery and protection of sensitive invitation URLs remain incompletely verified. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The PR implements the long-link payload and single-encoding changes for Resolution Handle the per-app fallback URL when the testnet template ID is empty, or ensure
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Final review complete — no blockers (commit c581247) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The invitation compatibility changes are focused, and all 11 added unit tests passed with the testnet wallet variant compiling successfully. Independent reproduction confirmed one blocking regression: duplicating the invitation payload in the shared URL can exceed WorkManager's output limit after funding has already been broadcast. The credential-logging observation is valid but repeats an existing exposure and is retained only as a separate follow-up.
🔴 1 blocking
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: security-auditor); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a contained but multi-file behavioral change to invitation-link construction and parsing, including URL encoding, AppsFlyer fallback handling, and repository logic with new tests, but it does not affect funds, cryptography, consensus, key handling, or storage migrations. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— security-auditor (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 13% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt`:
- [BLOCKING] wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt:693-698: Keep the long invitation URL out of WorkManager output Data
Returning shareLink as shortLink causes SendInviteWorker to persist the full URL and then include it in workDataOf(KEY_APPSFLYER_LINK to invitation.shortDynamicLink) at lines 139–145. WorkManager limits serialized Data to 10,240 bytes. This URL now contains the entire invitation twice, in af_dp and deep_link_value, including the hexadecimal InstantSend lock whose size grows with the funding transaction's input count. An independent SDK 6.17.0 reproduction with a 64-input-sized ISDLOCK produced a 10,806-character shared URL, and constructing the worker output threw IllegalStateException: Data cannot occupy more than 10240 bytes when serialized. The equivalent single-payload URL fit in 6,078 bytes of output. Fragmented wallets can require this many inputs, and the funding path does not impose a smaller input-count limit. The worker catches the exception and reports failure after broadcasting funding and saving the invitation; retrying reuses the same oversized saved URL. Keep the compatible URL in Room, pass only an invitation identifier through WorkManager, and load the sharing URL from the database in the consumer.
Out-of-scope follow-up suggestions (2)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Redact invitation credentials from diagnostic logs and support attachments — InvitationLinkData.create embeds the decrypted asset-lock private key in the pk parameter. Before this PR, TopUpRepository already logged both the complete invitation payload and generated URL. WalletApplication sends INFO messages to logcat and wallet.log, and ContactSupportViewModel can attach those files to support reports. Someone receiving an exported log could obtain the credential needed to claim an unused invitation's funded identity credits. The added share-link log repeats the same credential exposure through the same logging sinks rather than introducing a new disclosure boundary.
- Follow-up: Track a separate remediation to redact invitation credentials from generation and incoming-link logs, with regression coverage for diagnostic exports.
- Invite WIF private key written to logcat in AppsFlyer link logs — Out of scope as an inline PR finding: the base version of createAppsFlyerLink already logged invitationLinkData.link, the SDK-generated long URL, and the service response in full. The new shareLink and deep_link_value logs repeat the same credential through existing sinks. The concrete diagnostic-export exposure is consolidated into the separate follow-up, without carrying forward the unsupported claim that the asset-lock transaction can simply be imported and swept.
- Follow-up: Consider creating a separate issue or author/maintainer-requested PR for this.
Nothing reads it: Android uses the legacy conversion listener, which delivers af_dp, and iOS reads af_dp from the URL itself. Duplicating the payload made the shared link ~57% longer for no consumer. Co-Authored-By: Claude Fable 5.1 <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The invitation-link changes address the stated iOS compatibility requirements, but always returning the long URL still exposes invitation creation to WorkManager's output-size limit. Independently inspecting Dash's lock serialization and reproducing the exception with WorkManager 2.9.1 confirms that removing deep_link_value does not resolve the prior blocker.
🔴 1 blocking
1 carried-forward finding(s) already raised on this PR; not re-posting as new inline comments.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: security-auditor); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The diff makes small, contained changes to invitation URL selection, host/path normalization, and backward-compatible avatar decoding with focused tests, without changing funds movement, cryptography, key handling, or other critical surfaces. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— security-auditor (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 98% left, weekly 78% left; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 13% left, 5h 100% left) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt`:
- [BLOCKING] wallet/src/de/schildbach/wallet/service/platform/TopUpRepository.kt:693-698: Keep the long invitation URL out of WorkManager output Data
(existing thread: https://github.com/dashpay/dash-wallet/pull/1587#discussion_r4147359376)
The long URL returned as DynamicLink.shortLink is saved as invitation.shortDynamicLink and then placed in SendInviteWorker's output Data at line 144. WorkManager limits serialized Data to 10,240 bytes. Removing deep_link_value eliminates the duplicate payload, but InvitationLinkData.create() still embeds the complete hex-serialized InstantSend lock in af_dp; each funding input contributes another 36 bytes, or 72 URL characters. Funding uses wallet coin selection without a small input-count bound. A single-payload URL containing a 150-input lock measures 11,355 characters even without campaign or preview parameters, and passing it to the actual WorkManager 2.9.1 Data.Builder reproduces IllegalStateException: Data cannot occupy more than 10240 bytes when serialized. The funding transaction has already been sent and the invitation saved when this exception is caught and reported as worker failure, so the creation screen leaves its share/copy controls disabled. This PR makes that failure unavoidable for sufficiently large locks even when AppsFlyer successfully returns a short link. Keep the long share URL in InvitationsDao, return the funding address or another invitation identifier through WorkManager, and load the saved URL in the UI.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Invitation claim private keys are included in diagnostic logs — TopUpRepository logs the complete af_dp payload and long invitation URL, including the WIF claim key. WalletApplication enables INFO logging to both logcat and rolling wallet log files, and the support flow collects those log files. The same secret-bearing payload was already logged at the PR base, so the additional share-link log does not introduce a distinct exposure requiring this PR to expand its scope.
- Follow-up: Track a separate change to redact invitation claim-key material from all invitation logs, including nested af_dp payloads.
WorkManager caps serialized output Data at 10 KB. The share link embeds the hex InstantSend lock, which grows by 72 characters per input of the funding transaction, so a fragmented wallet could push the worker's output over the limit after the funding transaction was already sent. The link is only ever stored in the invitation table now; the created screen reads it from the Room row it already observes by user id. Co-Authored-By: Claude Fable 5.1 <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Reviewed the complete diff at c581247 and verified no in-scope defects. The prior WorkManager output-size issue is fixed; the reported memo-overwrite regression is pre-existing, not introduced by this PR. Validation was static only: the supplied CI snapshot shows check passing and build still in progress, and on-device iOS universal-link validation remains outstanding.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The diff changes invitation URL construction, backward-compatible decoding, and asynchronous sharing state across several components, but does not introduce large or intricate changes to a critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 15% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Redact bearer invitation credentials from application and support logs — InvitationLinkData.create() embeds the decrypted asset-lock private key in the pk parameter. TopUpRepository.kt:685–689 and InviteHandlerViewModel.kt:86–105 log invitation URLs or payloads; WalletApplication persists INFO messages, and ContactSupportViewModel can attach those log files to support reports. A recipient of logs containing an unclaimed invitation could extract its bearer key and claim the funded invitation. The base revision already logs the full long URL, af_dp payload, and parameter map; the added share-link message duplicates this existing exposure.
- Follow-up: Track a separate security follow-up to remove or redact private-key-bearing invitation URLs and parameter maps from generation, attribution, inbound handling, and exported diagnostic logs.
…sdk-phase-1-v11.9.1 Brings in #1619, phase-1's own port of master's #1587 (iOS-compatible invite links), which this branch also carries from master. The shared files (InviteShareLink, DynamicLink, InviteShareLinkTest) were identical. The four conflicted invite files take #1619's side: - TopUpRepository: #1619 logs only the shape of the share link, not the links themselves, which carry the invitation's bearer key. - InviteCreatedFragment / InvitationFragmentViewModel: equivalent share-enable rule and doc comment; #1619's wording kept. - InvitationLinkDataTest: same avatar-url cases under #1619's names. - InvitationLinkData: auto-merged with looksLikeUrl() defined twice (both sides added it); taken as #1619's file. This branch's own changes in those files (awaitRestored barriers, the payment-still-confirming invite failure) are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
Fixes #1586.
The iOS wallet has no AppsFlyer SDK: it only opens an invitation whose
dashpay://invitepayload rides in the URL asaf_dp, and only from a domain it claims (dashpay.onelink.me/dashpaytest.onelink.me). Three things on the Android side broke that, on testnet and on mainnet:af_dp, which iOS cannot resolve. iOS compatibility so far depended on that request failing (it returned 400 in every log we have). The shared link is now always the SDK's long link; AppsFlyer's answer is kept inInvitation.dynamicLinkfor reference only.go.onelink.mefallback. When the app id is not part of the OneLink template (the_testNet3package is not ink7Pz), the SDK never receives the template domain and builds the link ongo.onelink.me, whose apple-app-site-association does not list the Dash app. Note the issue describes the<id>.app.appsflyersdk.com/<package>shape; that one comes from an emptyAPPSFLYER_TEMPLATE_ID_TESTNET(decompiledLinkGenerator.setBaseURLin SDK 6.17.0).InviteShareLinkputs the build's brand domain back and adds a trailing slash so the path matches the AASA pattern/<template>/*. AppsFlyer serves/<template>/exactly like/<template>(checked with iPhone and Android user agents).avatar-urlwas percent-encoded twice (URLEncoder+Uri.Builder). Android undid it on read, but the platform SDK parser used by iOS decodes once and gothttps%3A%2F%2F...as the avatar URL. The link now encodes it once; reading still decodes links from older wallets.Not fixed here, because it is AppsFlyer dashboard configuration:
hashengineering.darkcoin.wallet_testis in no OneLink template, so its landing page still targetsorg.dash.dashpay.testneton Android. Either give_testNet3its own template or create test invitations fromstagingonly.Related PR's and Dependencies
dashpay.onelink.me; until it ships, mainnet links open on iOS only by paste)How Has This Been Tested?
InviteShareLinkTest(7) andInvitationLinkDataTest(4, Robolectric), run with:wallet:test_testNet3DebugUnitTest._testNet3build and confirmed thego.onelink.mehost and the double-encodedavatar-url.go.onelink.me,dashpaytest.onelink.meanddashpay.onelink.meAASA files and landing pages with curl.Checklist:
🤖 Generated with Claude Code
Summary by CodeRabbit