Skip to content

Honor af affiliate parameter on deep.edge.app links#5999

Open
j0ntz wants to merge 1 commit intodevelopfrom
jon/deep-edge-af-param
Open

Honor af affiliate parameter on deep.edge.app links#5999
j0ntz wants to merge 1 commit intodevelopfrom
jon/deep-edge-af-param

Conversation

@j0ntz
Copy link
Copy Markdown
Contributor

@j0ntz j0ntz commented Apr 23, 2026

Description

Asana task

Extend deep link parsing so https://deep.edge.app/... URLs can carry an af affiliate parameter the same way dl.edge.app already does. When af appears on a URL that also has a payload (e.g. a pay private-key import), the deep link now resolves to a new AffiliateLink wrapper that activates the promotion and then delegates to the inner link. When af is the only meaningful content (empty path or explicit /promotion/... path), the result collapses to a plain PromotionLink — matching the dl.edge.app behavior.

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 extracts af from deep.edge.app URLs and wraps or unwraps the result.
  • src/types/DeepLinkTypes.ts — new AffiliateLink type in the DeepLink union + updated header comment.
  • src/actions/DeepLinkingActions.tsx — handle affiliate type: 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?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

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 dispatch flow so deep.edge.app URLs can trigger promotion activation and then route to another payload, which could affect inbound link handling if parsing/recursion is wrong.

Overview
Adds support for ?af=<installerId> on https://deep.edge.app/... URLs.

When af is present, parsing now either collapses to a promotion link (if the URL is effectively just a promo) or produces a new affiliate wrapper that activates the promotion and then delegates to the inner deep link; the dispatcher (DeepLinkingActions) gains a matching affiliate case, and tests/CHANGELOG are updated to cover these scenarios (including host lookalike protection).

Reviewed by Cursor Bugbot for commit 3fc3234. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 72d2c96. Configure here.

Comment thread src/util/DeepLinkParser.ts Outdated
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.
@j0ntz j0ntz force-pushed the jon/deep-edge-af-param branch from 1c43aff to 3fc3234 Compare April 23, 2026 23:57
Copy link
Copy Markdown
Contributor

@samholmes samholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need answers and understanding otherwise it seems fine..

Comment on lines +155 to +159
export interface AffiliateLink {
type: 'affiliate'
installerId: string
link: DeepLink
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's with the new type? Why don't we just use the old type and call it a day? What's the new type for and what does it do? I expected a simple translation from deep.edge.app to a dl.edge.app kind of thing.

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.

2 participants