Open
Conversation
- Handle explicit list of Relay API statuses, throw on unrecognized values - Add relayPollingInterval and relayPollingTimeout feature flags - Ignore transient network errors during polling, retrying until timeout - Use distinct error when failing incomplete transactions at startup whose required transaction IDs are all confirmed
- Move default polling interval fallback inside getRelayPollingInterval - Remove timeout handling duplication in waitForRelayCompletion - Consolidate changelog into single entry with nested detail - Update incomplete startup error message wording
… statuses - Add unit tests for getRelayPollingInterval and getRelayPollingTimeout - Move RELAY_PENDING_STATUSES and RELAY_FAILURE_STATUSES to constants.ts - Add missing 'depositing' status from Relay v3 API docs - Add PR number (#8189) to changelog entries
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
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.
Explanation
Relay status polling currently treats any non-success/failure status as pending, meaning an unexpected API response silently loops forever. This PR hardens the polling logic to handle an explicit set of known statuses and throw immediately on unrecognized values, preventing silent infinite loops.
Additionally, the polling interval and timeout are now configurable via feature flags (
relayPollingIntervalandrelayPollingTimeout), and transient network errors are silently retried instead of immediately propagating — only surfacing if the configured timeout is reached.On the transaction controller side, the startup cleanup now uses a distinct error message when an incomplete transaction has
requiredTransactionIdsthat are all confirmed, distinguishing "relay completed but parent didn't finish" from the general incomplete case.References
Checklist
Note
Medium Risk
Changes the Relay polling loop and error handling, which can affect Pay intent completion timing and failure modes, but is guarded by explicit status handling and added tests.
Overview
Hardens Relay status polling for MetaMask Pay submissions. The Relay completion loop now explicitly treats only known statuses as pending, throws on unrecognized status values, and retries transient network errors rather than failing immediately.
Adds feature-flag configurability for polling behavior. Polling interval and an optional timeout are read from remote feature flags, with a timeout error surfaced when exceeded; related constants/types and unit tests were updated.
Improves startup failure diagnostics in
TransactionController. Incomplete approved/signed transactions are still failed on boot, but now use a distinct error message whenrequiredTransactionIdsexist and are allconfirmed, with new tests covering the message selection.Written by Cursor Bugbot for commit e0ce55a. This will update automatically on new commits. Configure here.