feat: use shared trackError in stellar - #250
Open
taran-a wants to merge 4 commits into
Open
Conversation
taran-a
force-pushed
the
feat/shared-track-error-util
branch
from
September 2, 2026 08:58
8fa2cf2 to
7c14039
Compare
taran-a
force-pushed
the
feat/shared-track-error-util
branch
from
September 2, 2026 08:59
7c14039 to
84b9966
Compare
taran-a
force-pushed
the
feat/stellar-use-shared-track-error-util
branch
from
September 2, 2026 12:33
fa04df0 to
1c4e3b1
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
There is an unused import in confirmSend.test.ts that is likely to fail lint/typecheck and should be removed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR migrates the Stellar snap’s error reporting to the shared @metamask/snap-networks-utils implementation, removing the snap-local trackError helper and wiring error tracking/normalization through createSnapErrorHandling.
Changes:
- Replace local
trackErrorimplementation withcreateSnapErrorHandling({ getSnapProvider, logError })in the Stellar snap error utilities. - Update call sites and tests to import/spy on
trackErrorfromutils/errorsinstead ofutils/snap. - Refresh the snap manifest
shasumto reflect the rebuilt bundle.
File summaries
| File | Description |
|---|---|
| packages/stellar-wallet-snap/src/utils/snap.ts | Removes the local trackError implementation from snap utilities. |
| packages/stellar-wallet-snap/src/utils/errors.ts | Introduces shared error handling via createSnapErrorHandling, exporting trackError + withCatchAndThrowSnapError. |
| packages/stellar-wallet-snap/src/utils/mocks/snap.ts | Updates the snap utils mock to stop re-exporting the removed trackError. |
| packages/stellar-wallet-snap/src/services/on-chain-account/OnChainAccountSynchronizeService.test.ts | Updates tests to spy on trackError from utils/errors. |
| packages/stellar-wallet-snap/src/handlers/keyring/base.ts | Switches trackError import to utils/errors. |
| packages/stellar-wallet-snap/src/handlers/clientRequest/confirmSend.test.ts | Updates tests to spy on trackError from utils/errors (and still mocks snap utils). |
| packages/stellar-wallet-snap/snap.manifest.json | Updates bundle shasum for the new build output. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+52
to
54
| import * as errorsUtils from '../../utils/errors'; | ||
| import { logger } from '../../utils/logger'; | ||
| import * as snapUtils from '../../utils/snap'; |
Contributor
Author
There was a problem hiding this comment.
this import is indeed used.
const trackTransactionAddedSpy = jest.spyOn(
snapUtils,
'trackTransactionAdded',
);
const trackTransactionRejectedSpy = jest.spyOn(
snapUtils,
'trackTransactionRejected',
);
const trackTransactionApprovedSpy = jest.spyOn(
snapUtils,
'trackTransactionApproved',
);
taran-a
force-pushed
the
feat/stellar-use-shared-track-error-util
branch
from
September 2, 2026 15:17
1c4e3b1 to
c8cf0ea
Compare
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
Use shared trackError util in the stellar snap.
References
Checklist