Skip to content

Conversation

@jpuri
Copy link
Contributor

@jpuri jpuri commented Jan 28, 2026

Explanation

In incoming transaction helper if any chain goes down on web sockets, start polling for it.

References

Fixes #12345

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes incoming transaction retrieval control flow by dynamically starting/stopping polling based on backend network status events, which could affect update frequency and chain coverage if status events or chain-ID parsing behave unexpectedly.

Overview
Adds a network fallback for WebSocket-based incoming transaction retrieval. When isIncomingTransactionsUseWebsocketsEnabled is on, IncomingTransactionHelper now subscribes to AccountActivityService:statusChanged, tracks which supported chains are currently "down", and starts/stops a polling loop accordingly; interval polls are scoped to only the affected chainIds.

Plumbs chain scoping through the remote fetch path. RemoteTransactionSourceRequest gains optional chainIds, AccountsApiRemoteTransactionSource.fetchTransactions uses it (defaulting to SUPPORTED_CHAIN_IDS), TransactionController allows the new status event, and tests/changelog are updated to cover the fallback behavior.

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

@jpuri jpuri requested a review from a team as a code owner January 28, 2026 14:37
@jpuri jpuri requested a review from a team as a code owner January 28, 2026 15:25
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.

@jpuri jpuri requested a review from a team as a code owner January 29, 2026 09:41

this.#onInterval().catch((error) => {
log('Initial polling failed', error);
log('Polling failed', error);
Copy link
Member

Choose a reason for hiding this comment

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

This was intentional to distinguish that the first attempt failed, rather than a future interval based one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated

for (const caip2ChainId of chainIds) {
const hexChainId = this.#caip2ToHex(caip2ChainId);

if (!hexChainId || !SUPPORTED_CHAIN_IDS.includes(hexChainId)) {
Copy link
Member

Choose a reason for hiding this comment

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

Are we adding the dynamic supported chains via /supportedNetworks in a separate ticket?

Copy link
Member

Choose a reason for hiding this comment

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

Can we add a log here for helpful debug, maybe separately if chain ID not recognised or if not supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For dynamic chain support yes a separate task will be better as it will require changes in AccountsApiRemoteTransactionSource

I added log to the PR

});
}
} else if (!this.#chainsToPoll.includes(hexChainId)) {
// status === 'down'
Copy link
Member

Choose a reason for hiding this comment

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

Should we be explicit in case they ever add more statuses?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated

}

if (!hasChanges) {
return;
Copy link
Member

Choose a reason for hiding this comment

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

Another log for good debug?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PR is updated

@jpuri jpuri requested a review from matthewwalsh0 January 29, 2026 13:44
@jpuri jpuri enabled auto-merge January 29, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants