Skip to content

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

Merged
j0ntz merged 1 commit intodevelopfrom
jon/deep-edge-af-param
Apr 28, 2026
Merged

Honor af affiliate parameter on deep.edge.app links#5999
j0ntz merged 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 execution flow to auto-activate promotions from deep.edge.app URLs 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 on https://deep.edge.app/... URLs. When present, the parser either collapses to a normal promotion link (if there is no meaningful payload) or returns a new affiliate wrapper that activates the promotion and then delegates to the parsed inner deep link.

Updates link handling to process affiliate by dispatching activatePromotion and then recursively handling the wrapped link, and expands unit tests and the changelog to cover the new deep.edge.app affiliate 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.

Comment thread src/util/DeepLinkParser.ts Outdated
@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 thread src/types/DeepLinkTypes.ts
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.

@j0ntz I realize I really don't care if there is an extra type added. As long it works.

@j0ntz
Copy link
Copy Markdown
Contributor Author

j0ntz commented Apr 27, 2026

Addressed in inline reply explaining why the new AffiliateLink wrapper is needed for combined affiliate + payload deep links.

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 3fc3234 to b724830 Compare April 28, 2026 00:16
@j0ntz j0ntz merged commit a47da29 into develop Apr 28, 2026
3 of 4 checks passed
@j0ntz j0ntz deleted the jon/deep-edge-af-param branch April 28, 2026 00:19
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 b724830. Configure here.

case 'affiliate':
await dispatch(activatePromotion(link.installerId))
await handleLink(navigation, dispatch, state, link.link)
break
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b724830. Configure here.

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