Add remote enable/disable of spend providers via info server#6032
Open
j0ntz wants to merge 1 commit into
Open
Conversation
Contributor
Author
Contributor
Author
ed30d64 to
364b5c0
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 364b5c0. Configure here.
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.
364b5c0 to
dbc2747
Compare
Contributor
Author
📸 Test evidence — info-server category gating (sim, maestro)agent proof 1215731967028387 01 giftcard categories baseline agent proof 1215731967028387 02 giftcard categories apparel disabled agent proof 1215731967028387 03 giftcard marketplace flow pass Captured by the agent's in-app test run (build-and-test). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.







CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
Requires edge-info-server to publish the new
spendInforollup field (separate PR). This GUI PR readsspendInfoforward-compatibly, so it is backward compatible and inert against the currently published info server: with nospendInfoin the rollup, nothing is disabled. The feature activates once edge-info-server publishes the field and theedge-info-serverdependency is bumped.Requirements
If you have made any visual changes to the GUI. Make sure you have:
Description
Asana task
Adds remote enable/disable of "spend" (gift-card) providers, mirroring the existing exchange-plugins (
exchangeInfo) pattern.A new
spendInfoconfig is read from the info server rollup and cached in redux (state.ui.spendInfo). It carries a genericdisablePluginsNestedDisableMapkeyed 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 byproductId.{ 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/isSpendProviderDisabledhelpers. TheNestedDisableMapcleaner is reused fromExchangeInfoActions.Changes:
SpendInfoActions.ts:asSpendInfocleaner,updateSpendInfo()thunk, and gating helpers.SpendInfoReducer.tswired intouiReducer(state.ui.spendInfo);UPDATE_SPEND_INFOaction.Services.tsx: dispatchupdateSpendInfo()in the existing info-server refresher.GiftCardMarketScene.tsx: apply per-brand and per-provider gating.Tested on the iOS simulator by injecting a
spendInfodisable map (simulating the server config, since the field is not yet published): disabling two Phaze brands byproductIdplus 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
spendInfois 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 samedisablePlugins/NestedDisableMappattern asexchangeInfo.SpendInfoActionsparsesspendInfo, dispatchesUPDATE_SPEND_INFOintostate.ui.spendInfo, and exposesisSpendProviderDisabled/isSpendBrandDisabled(whole-provider vs per-Phaze-productId).Servicesrefreshes it on the existing info-server interval alongside exchange info.asNestedDisableMapis 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.