Skip to content

Comments

Jon/fix/phaze 3.1#5943

Open
swansontec wants to merge 12 commits intodevelopfrom
jon/fix/phaze-3.1
Open

Jon/fix/phaze 3.1#5943
swansontec wants to merge 12 commits intodevelopfrom
jon/fix/phaze-3.1

Conversation

@swansontec
Copy link
Contributor

@swansontec swansontec commented Feb 17, 2026

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)

Note

Medium Risk
Touches the gift card purchase and send navigation path (fee locking, payment amount padding, tx metadata), which can affect payments if incorrect. Most changes are UX/error handling and parsing hardening, reducing crash risk but requiring end-to-end testing against the Phaze API.

Overview
Adds a new giftCardAccountInfo scene (reachable from failed cards and developer settings) that gates and reveals Phaze identity info and allows copying it for support, and updates the gift card menu/modal and list cards with a Get Help path.

Reworks gift card list polling/caching to use TanStack Query (focus-gated polling, per-account caching), adds distinct confirming/failed states with shimmer/dimming behavior, and improves UX by distinguishing network vs service failures and disabling purchase when offline/error.

Hardens purchase flow by locking send fees to high, padding payment quantity to avoid underpayment, validating payment address/cart items, persisting richer tx metadata (quoteId + orderId + productId), and updating transaction details to display/copy the new fields with backward compatibility.

Makes Phaze API parsing more tolerant (healing array cleaners, optional deliveryAddress, adds failed status) and surfaces provider errors via useGiftCardProvider for UI warnings.

Written by Cursor Bugbot for commit 4330a18. This will update automatically on new commits. Configure here.


Copy link
Contributor Author

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

I can't actually approve / reject the PR, since I opened it, but here are my comments. Also check the AI comments.

@j0ntz
Copy link
Contributor

j0ntz commented Feb 20, 2026

Both issues addressed: cart[0] null check added, offline cold start now sets loadError.

@j0ntz j0ntz force-pushed the jon/fix/phaze-3.1 branch from e831555 to 0fdd593 Compare February 20, 2026 01:11
@j0ntz
Copy link
Contributor

j0ntz commented Feb 20, 2026

Note the additional commit. After discussing with Phaze, the only remaining issue causing failed purchases is intermittent underpayments by 0.00000001 (chain-agnostic - they always quote in exchange amounts). After extensive inspection, there doesn't appear to be a way we could be underpaying on our side, yet they strongly claim that there is no drift in their quoted amount vs validated amount.

Padding by 0.00000002 and crossing fingers.

@j0ntz j0ntz force-pushed the jon/fix/phaze-3.1 branch from 0fdd593 to 90fd9b7 Compare February 20, 2026 01:57
@j0ntz
Copy link
Contributor

j0ntz commented Feb 20, 2026

Fixed: Removed the dead catch block since TanStack Query's refetch() always resolves. Added a comment explaining this behavior.

@j0ntz j0ntz force-pushed the jon/fix/phaze-3.1 branch from 90fd9b7 to 050c626 Compare February 20, 2026 02:40
@j0ntz j0ntz force-pushed the jon/fix/phaze-3.1 branch 3 times, most recently from 4fe1ee3 to 3f7d7da Compare February 20, 2026 20:37
@j0ntz j0ntz force-pushed the jon/fix/phaze-3.1 branch from 3f7d7da to 158b3a0 Compare February 20, 2026 20:57
Copy link

@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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@j0ntz j0ntz force-pushed the jon/fix/phaze-3.1 branch from 158b3a0 to c364b35 Compare February 21, 2026 00:29
@j0ntz
Copy link
Contributor

j0ntz commented Feb 21, 2026

Fixed: Separated brands fetch into its own useQuery with staleTime: Infinity so it's fetched once per session. Removed getMarketBrands from the orders polling query.

This addresses the "Brands API called on every 10-second poll cycle" feedback.

Copy link
Contributor

@j0ntz j0ntz left a comment

Choose a reason for hiding this comment

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

William approved

Add asTolerantArray helper that skips malformed items instead of
throwing on the entire array. Apply it to brand lists and voucher
arrays so a single bad entry doesn't break the whole UI. Also add
'failed' to recognized order statuses and make deliveryAddress
optional with an empty-string default.
Expose isError/error from useGiftCardProvider so scenes can detect
provider initialization failures. On GiftCardListScene, stop clearing
orders on API errors (keep last-known-good data visible), pause
polling when offline and auto-resume on reconnect, and show an
informational warning banner that auto-clears on success. On
GiftCardMarketScene, gate the brand query on network connectivity so
it auto-retries when online, and show a warning instead of an infinite
loader when the initial fetch fails. On GiftCardPurchaseScene, guard
against empty delivery addresses and show a warning when the provider
fails to initialize.
Add isCreatingOrder to the early-return guard in handleNextPress so a
second tap during the brief window before React disables the button
cannot trigger duplicate order creation.
Distinguish between awaiting blockchain confirmations (txid exists but
no voucher yet), pending voucher delivery, and failed/expired orders.
Failed cards are dimmed like redeemed cards.
Display the Phaze quoteId at the top of the kebab menu modal for
easier debugging and support reference.
Extend the gift card tx details card with a Quote ID row and a single
copy button on the right side that copies all data at once. Dividers
stop short of the copy button. The redeem row remains separate with
its own chevron.

Document backward-compat: orderId stores quoteId in prior versions.
New scene to view Phaze account credentials behind a confirmation wall.
Shows quoteId context when accessed from a specific card. After the user
confirms a ConfirmContinueModal warning about redemption risk, identity
data (email, user ID) is revealed with copy buttons.
Add a 'Get Help' row to the gift card kebab menu that navigates to the
new Gift Card Account Information scene with the quoteId. Also surface
a 'Get Help' button on failed cards, reusing the existing redeem button
pattern.
Add a Gift Card Account Info row in the developer mode section of
SettingsScene that navigates to the new account information scene.
Set networkFeeOption to high and lock the fee tile so users cannot
lower the fee priority. Gift card orders are time-sensitive with
expiring quotes, so high priority reduces the risk of missed deadlines.
Populate quoteId, productId, and orderId correctly in the saved action
now that the core type has explicit fields. Update GiftCardDetailsCard
with backward-compat detection: if quoteId is absent, treat orderId as
the quoteId per legacy behavior.
@j0ntz j0ntz force-pushed the jon/fix/phaze-3.1 branch 2 times, most recently from c364b35 to 4330a18 Compare February 21, 2026 23:03
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.

3 participants