Honor af affiliate parameter on deep.edge.app links#5999
Conversation
1c43aff to
3fc3234
Compare
samholmes
left a comment
There was a problem hiding this comment.
Need answers and understanding otherwise it seems fine..
|
Addressed in inline reply explaining why the new |
Extract the af query parameter from deep.edge.app deep links and activate the promotion alongside the inner payload. Empty-path and explicit promotion paths collapse to a plain PromotionLink to match dl.edge.app. Payloads with an installerId now route through a new AffiliateLink wrapper that dispatches activatePromotion before delegating to the inner link handler.
3fc3234 to
b724830
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b724830. Configure here.
| case 'affiliate': | ||
| await dispatch(activatePromotion(link.installerId)) | ||
| await handleLink(navigation, dispatch, state, link.link) | ||
| break |
There was a problem hiding this comment.
Promotion failure blocks inner link processing in affiliate handler
Medium Severity
If activatePromotion throws (e.g. asServerTweaks rejects malformed server JSON, or saveAccountReferral hits a disk I/O error), the error propagates up and the second await handleLink(…, link.link) never executes. For the BCHx gift-card scenario, this means a transient promotion-server hiccup silently prevents the private-key import — the more important payload — from ever being processed.
Reviewed by Cursor Bugbot for commit b724830. Configure here.


Description
Asana task
Extend deep link parsing so
https://deep.edge.app/...URLs can carry anafaffiliate parameter the same waydl.edge.appalready does. Whenafappears on a URL that also has a payload (e.g. apayprivate-key import), the deep link now resolves to a newAffiliateLinkwrapper that activates the promotion and then delegates to the inner link. Whenafis the only meaningful content (empty path or explicit/promotion/...path), the result collapses to a plainPromotionLink— matching thedl.edge.appbehavior.Unlocks the BCHx gift-card use case: a single scanned QR can both import the BCH private key and activate the
af=<installerId>referral that surfaces an in-app Telegram-group card.Asana: BCHx Cards – Add referral parameter to deep.edge.app links
Files touched
src/util/DeepLinkParser.ts— pre-pass that extractsaffromdeep.edge.appURLs and wraps or unwraps the result.src/types/DeepLinkTypes.ts— newAffiliateLinktype in theDeepLinkunion + updated header comment.src/actions/DeepLinkingActions.tsx— handleaffiliatetype:activatePromotion+ recurse into inner link.src/__tests__/DeepLink.test.ts— new cases for bare-af, promotion+af (no double wrap), pay+af, plugin+af.CHANGELOG.md.CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Requirements
If you have made any visual changes to the GUI. Make sure you have:
No visual changes — deep-link parser + action-layer only. Verified via
yarn test(all related suites pass).Note
Medium Risk
Changes deep-link parsing and execution flow to auto-activate promotions from
deep.edge.appURLs and then continue handling an inner payload, which could alter how some inbound links route or trigger promotions.Overview
Adds support for an
?af=<installerId>affiliate parameter onhttps://deep.edge.app/...URLs. When present, the parser either collapses to a normalpromotionlink (if there is no meaningful payload) or returns a newaffiliatewrapper that activates the promotion and then delegates to the parsed inner deep link.Updates link handling to process
affiliateby dispatchingactivatePromotionand then recursively handling the wrapped link, and expands unit tests and the changelog to cover the newdeep.edge.appaffiliate behaviors (including rejecting lookalike hosts).Reviewed by Cursor Bugbot for commit b724830. Bugbot is set up for automated code reviews on this repo. Configure here.