Repository navigation
Show maintenance windows in the dashboard and pause transfers - #1398
Merged
Merged
Conversation
The dashboard never read /v1/maintenance/status, so senders only learned about a window from 503s on quote and ramp calls. The e2e mock serves an inactive window by default so every spec's unmatched-request check keeps passing.
The API rejects quote creation and ramp register/update/start during a window, so starting a transfer or confirming an onramp payment then can only fail. Disable those buttons while the banner is up, matching the widget.
✅ Deploy Preview for vrtx-dashboard ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortexfi canceled.
|
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The generic quote errors told senders to try another amount or token, which cannot help while the API's maintenance guard rejects every quote.
The API stops rejecting at end_datetime, but the dashboard kept the banner and disabled actions until the next 5-minute poll.
A window opening between the last poll and the wallet broadcast 503s the final /ramp/update after funds moved, with no retry for offramps. Re-check the status right before signing so the transfer fails while nothing has left the wallet.
…nance Only the confirm button was disabled, so senders could still pay into a ramp whose 15-minute start deadline passes before the window ends. Explain the pause, and hide the details when the window outlasts the ramp.
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.
Why
The dashboard never read
/v1/maintenance/status. During a scheduled maintenance window the API rejects quote creation and ramp register/update/start with a 503 (rejectDuringActiveMaintenance), so dashboard senders only found out through failing requests. The widget shows a banner and disables its submit buttons in that case; the dashboard now does the same. This is a companion to #1396, which restores the widget's banner.Change
MaintenanceService.getStatusand auseActiveMaintenance()hook built on React Query. The hook refetches every 5 minutes and when the tab regains focus, and returns the active window ornull. React Query shares the request across all components that use the hook.MaintenanceBannerin the app shell's sticky header, using the existingbg-warningtoken. It shows the operator's title and message plus the window's end time, on every authenticated page.These buttons are disabled while a window is active: offramp
Send ≈ …, onrampContinue to payment, andI have made the payment(which calls/ramp/start).Follow-ups from the
/vortex-reviewpass:end_datetime(puremaintenanceRefetchInterval), so actions unlock about 15 s after the API does instead of up to 5 minutes later.signUserTransactionsre-checks the status right before the wallet signs an offramp. A window that opened since the last poll stops the transfer before funds move; if the check itself fails, the API guard still applies.Product and testing docs updated (
docs/product-dashboard.md,docs/operations-testing.md).While a window is active, quote errors on the pay-in, pay-out and Get-a-quote pages say "Quotes are paused for scheduled maintenance. Try again once it ends." instead of the generic "try another amount or token" text. Quote requests still go out; the API rejects them.
Tests
e2e/maintenance.spec.tscovers four cases: an active window disables onrampContinue to payment, a window that starts while payment instructions are open disablesI have made the paymentonce the tab regains focus, an active window disables offrampSend, and quote errors on all three quote pages show the maintenance message when the API answers with its maintenance 503. Each case fails without its change.useActiveMaintenance.test.ts(refetch interval around a window's end) andtransfer.actors.test.ts(pre-signing check: active window stops before the wallet, inactive or failed check proceeds). The actors test fails without the check.unmatchedRequestscheck keeps passing.Verification
apps/dashboard:bun run typecheckclean,bun run test169/169, full Playwright suite 78/78