-
-
Notifications
You must be signed in to change notification settings - Fork 295
feat(snap-account-service): report migration error #9696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ccharly
merged 12 commits into
main
from
cc/feat/snap-keyring-v2-migration-error-reporting
Jul 30, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
64c0df1
feat(snap-account-service): report migration error
ccharly ab2f8e6
chore: lint
ccharly 148f2a4
chore: changelog
ccharly 6fde431
test: add missing test for coverage
ccharly cc380a1
fix: wrap errors in a safe way before reporting them
ccharly c3676d8
fix: re-use is*Error pattern
ccharly 6c92d88
chore: lint
ccharly 1af6f85
chore: cosmetic
ccharly 623b83b
chore: changelog
ccharly c13c352
chore: typo
ccharly 677c4d2
chore: safe -> withSafeError
ccharly a1d0bbf
chore: comment
ccharly File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No real sensitive data (from
error) should escape from here. I ran multiple checks with claude on this.This can be compared with living an error bubbles up from a
:withKeyring*call basically, which means, errors fromkeyring.{serialize,deserialize}could be thrown here.In this context, we mostly use Snap keyrings (legacy + Snap keyring v2), so we could expect errors coming from there.
The real errors we don't have much control over are
superstructerrors. We now wrap sensitive fields with our new decorator (superstruct.sensitive), but it's not widely used yet.The other alternative is to wrap each steps of the migration with various
try { ... } catch { throw Error('This step failed with ${text}'); }, but that would make any analysis still pretty difficult I guess...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, finally introduce a new pattern where we only report errors we know are "safe" to be reported.
It's not perfect, but I prefer this solution for now. Once we know why the migration is failing, we'll fix and eventually, remove those
SafeErrors.Though, I think the pattern is elegant enough that we could use it in place where we need it.
On a side note, we should over-abuse our new
superstruct.sensitivetoo to avoid letting dynamic value escape throughsuperstructvalidation IMO. But for now, it's not widespread enough.