Skip to content

Read ramp provider priority from the rampProviderPriority document - #6159

Draft
j0ntz wants to merge 3 commits into
developfrom
jon/ramp-provider-priority-doc
Draft

Read ramp provider priority from the rampProviderPriority document#6159
j0ntz wants to merge 3 commits into
developfrom
jon/ramp-provider-priority-doc

Conversation

@j0ntz

@j0ntz j0ntz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Technical Design Document

ramps-deeplink-provider-priority.md

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

https://github.com/EdgeApp/edge-info-server/pull/161

This PR is red until that one merges and publishes. It bumps edge-info-server to an unpublished ^3.14.0, so npm install fails with ETARGET and every downstream check with it. The lockfile bump follows the publish.

Requirements

No visual changes: this reorders an existing list, it does not alter any component.

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

Description

Asana: https://app.asana.com/0/1215088146871429/1217207276378713

Moves the ramps affiliate provider ordering off promoCards2 and onto the info server's new rampProviderPriority document.

The read this replaces went through filterInfoCards rather than getDisplayInfoCards specifically so that a card with localeMessages: {} could configure ordering and never render. That made behavior a display card wearing a disguise, which is why dismissing a visible card hid the ad but left its ordering running.

What changed:

  • useRampPreferredProviders reads infoServerData.rollup?.rampProviderPriority. The filterInfoCards read is gone; the function itself stays, since the promo carousel still uses it.
  • Matching moved into src/util/rampProviderPriority.ts as pure functions, so the rules are unit-testable without a store. An entry matches on installerId or an active promotion, rather than requiring both to agree when both were present, which had excluded a user who picked up the promotion after installing from somewhere else.
  • getActivePromoIds now unions the promoCards2-derived ids with the rampProviderPriority keys that apply. Without this the split would be incomplete: activePromotions was derived from cards alone, so a promo code naming a document entry was dropped on entry and again at every login, and the only way to activate one would have been to keep a display card alive purely to name its promo id.
  • src/docs/ramps-deeplink-provider-priority.md is updated to the new mechanism, with an edge-info-server design section and a phase 4 history entry.

Testing

17 new unit tests in src/__tests__/util/rampProviderPriority.test.ts cover the OR match, per-direction scoping, country include/exclude, date windows, an unparseable date, dedupe across entries, and the promo-id derivation. Full suite: 99 files, 720 tests, 107 snapshots, plus tsc and eslint clean against a locally built copy of the dependency.

On the iOS sim, in a throwaway account, driven end to end with the document hard-coded locally in place of the server response (the deployed info server does not serve it yet), so the real matching and ordering code ran against it. Screenshots below: the option list with no promotion, the code activated in Promotion Settings, and the same list reordered.

The middle screenshot is also the evidence for the getActivePromoIds change. Before it, Promotion Settings accepted the code and listed nothing.

j0ntz added 3 commits August 14, 2026 16:42
Handle the nullish case of ignoreExpiration explicitly, which
strict-boolean-expressions promotes to an error once the file leaves the
warning suppression list.
The affiliate provider ordering read promoCards2 through filterInfoCards,
which meant behavior config had to be a display card hidden behind empty
localeMessages. It now reads rampProviderPriority, which carries ordering
and nothing else.

Matching moves into a pure function so it can be unit-tested without a
store. An entry matches on installerId OR an active promotion, rather than
requiring both to agree when both are present, so a user who picked up the
promotion after installing elsewhere is no longer excluded.

The edge-info-server bump is to an unpublished version; the lockfile
follows once it publishes.
The doc described affiliate ordering as a read of promoCards2 through a
card with empty copy. That mechanism is gone, so the hook section, the
info server configuration blocks, decisions 10.5 and 10.6, the glossary and
the testing items now describe the rampProviderPriority document, with a
phase 4 entry recording what diverged.
@j0ntz

j0ntz commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence

baseline no promo

baseline no promo

promo activated

promo activated

paybis first

paybis first

Captured by the agent's in-app test run (build-and-test).

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.

1 participant