Skip to content

Add remote enable/disable of spend providers via info server#6032

Open
j0ntz wants to merge 1 commit into
developfrom
jon/edgespend-info-config
Open

Add remote enable/disable of spend providers via info server#6032
j0ntz wants to merge 1 commit into
developfrom
jon/edgespend-info-config

Conversation

@j0ntz

@j0ntz j0ntz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

Requires edge-info-server to publish the new spendInfo rollup field (separate PR). This GUI PR reads spendInfo forward-compatibly, so it is backward compatible and inert against the currently published info server: with no spendInfo in the rollup, nothing is disabled. The feature activates once edge-info-server publishes the field and the edge-info-server dependency is bumped.

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)

Description

Asana task

Adds remote enable/disable of "spend" (gift-card) providers, mirroring the existing exchange-plugins (exchangeInfo) pattern.

A new spendInfo config is read from the info server rollup and cached in redux (state.ui.spendInfo). It carries a generic disablePlugins NestedDisableMap keyed by providerId, so it works for any present or future spend provider:

  • { phaze: true } disables the entire Phaze provider.
  • { phaze: { "<productId>": true } } disables individual Phaze brands by productId.
  • { bitrefill: true } disables Bitrefill (a webview, so whole-provider only).

The Gift Card Marketplace scene filters disabled Phaze brands out of the grid and gates the Bitrefill option, via isSpendBrandDisabled / isSpendProviderDisabled helpers. The NestedDisableMap cleaner is reused from ExchangeInfoActions.

Changes:

  • SpendInfoActions.ts: asSpendInfo cleaner, updateSpendInfo() thunk, and gating helpers.
  • SpendInfoReducer.ts wired into uiReducer (state.ui.spendInfo); UPDATE_SPEND_INFO action.
  • Services.tsx: dispatch updateSpendInfo() in the existing info-server refresher.
  • GiftCardMarketScene.tsx: apply per-brand and per-provider gating.
  • Unit tests for the cleaner and gating helpers.

Tested on the iOS simulator by injecting a spendInfo disable map (simulating the server config, since the field is not yet published): disabling two Phaze brands by productId plus Bitrefill removes exactly those tiles from the marketplace while all other brands remain. See attached before/after screenshots.


Note

Low Risk
UI-only marketplace filtering with a safe empty default when spendInfo is absent; no payment or auth changes.

Overview
Adds remote gating for gift-card “spend” providers using a new info-server rollup field spendInfo, following the same disablePlugins / NestedDisableMap pattern as exchangeInfo.

SpendInfoActions parses spendInfo, dispatches UPDATE_SPEND_INFO into state.ui.spendInfo, and exposes isSpendProviderDisabled / isSpendBrandDisabled (whole-provider vs per-Phaze-productId). Services refreshes it on the existing info-server interval alongside exchange info. asNestedDisableMap is exported for reuse.

Gift Card Marketplace hides remotely disabled Phaze brands, omits Bitrefill when that provider is disabled, rebuilds category chips from enabled brands only, and resets the selected category if it becomes empty.

Unit tests cover the cleaner and gating helpers; changelog updated.

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

@j0ntz

j0ntz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence (iOS sim — spendInfo disable map injected to simulate server config)

agent proof 1215731967028387 01 market baseline

agent proof 1215731967028387 01 market baseline

agent proof 1215731967028387 02 market gated

agent proof 1215731967028387 02 market gated

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

Comment thread src/components/scenes/GiftCardMarketScene.tsx
@j0ntz

j0ntz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence — blanket disable of the entire Phaze provider ({ phaze: true }): all 536 brands removed, only Bitrefill remains

agent proof 1215731967028387 03 phaze disabled

agent proof 1215731967028387 03 phaze disabled

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

@j0ntz j0ntz force-pushed the jon/edgespend-info-config branch from ed30d64 to 364b5c0 Compare June 16, 2026 18:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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 364b5c0. Configure here.

Comment thread src/components/scenes/GiftCardMarketScene.tsx
Consume a new spendInfo config from the info server, mirroring the
exchangeInfo pattern. A generic disablePlugins NestedDisableMap keyed by
providerId gates the gift-card market: an entire provider (Phaze or Bitrefill)
or individual Phaze brands by productId can be disabled remotely. Reuses the
NestedDisableMap cleaner from ExchangeInfoActions.
@j0ntz j0ntz force-pushed the jon/edgespend-info-config branch from 364b5c0 to dbc2747 Compare June 16, 2026 18:19
@j0ntz

j0ntz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

📸 Test evidence — info-server category gating (sim, maestro)

agent proof 1215731967028387 01 giftcard categories baseline

agent proof 1215731967028387 01 giftcard categories baseline

agent proof 1215731967028387 02 giftcard categories apparel disabled

agent proof 1215731967028387 02 giftcard categories apparel disabled

agent proof 1215731967028387 03 giftcard marketplace flow pass

agent proof 1215731967028387 03 giftcard marketplace flow pass

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