-
Notifications
You must be signed in to change notification settings - Fork 210
Release to Staging - 2026-01-10 #1576
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
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dd474a1
Refactor insert id helper (#1573)
transphorm 9d4c622
Rename staleness hook file to `useProofDisclosureStalenessCheck` and …
transphorm 665545c
Centralize keychain error helpers and add unit tests (#1571)
transphorm c25a35e
chore: bump mobile app version to 2.9.10 (#1574)
github-actions[bot] 80d2181
remove staleness redirect (#1575)
transphorm 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| // SPDX-FileCopyrightText: 2025 Social Connect Labs, Inc. | ||
| // SPDX-License-Identifier: BUSL-1.1 | ||
| // NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE. | ||
|
|
||
| export type KeychainErrorIdentity = { | ||
| code?: string; | ||
| name?: string; | ||
| }; | ||
|
|
||
| type KeychainError = { | ||
| code?: string; | ||
| message?: string; | ||
| name?: string; | ||
| }; | ||
|
|
||
| export type KeychainErrorType = 'user_cancelled' | 'crypto_failed'; | ||
|
|
||
| export function getKeychainErrorIdentity( | ||
| error: unknown, | ||
| ): KeychainErrorIdentity { | ||
| const err = error as KeychainError; | ||
| return { code: err?.code, name: err?.name }; | ||
| } | ||
|
|
||
| export function isKeychainCryptoError(error: unknown): boolean { | ||
| const err = error as KeychainError; | ||
| return Boolean( | ||
| (err?.code === 'E_CRYPTO_FAILED' || | ||
| err?.name === 'com.oblador.keychain.exceptions.CryptoFailedException' || | ||
| err?.message?.includes('CryptoFailedException') || | ||
| err?.message?.includes('Decryption failed') || | ||
| err?.message?.includes('Authentication tag verification failed')) && | ||
| !isUserCancellation(error), | ||
| ); | ||
| } | ||
|
|
||
| export function isUserCancellation(error: unknown): boolean { | ||
| const err = error as KeychainError; | ||
| return Boolean( | ||
| err?.code === 'E_AUTHENTICATION_FAILED' || | ||
| err?.code === 'USER_CANCELED' || | ||
| err?.message?.includes('User canceled') || | ||
| err?.message?.includes('Authentication canceled') || | ||
| err?.message?.includes('cancelled by user'), | ||
| ); | ||
| } |
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.
Potential double logging of errors.
Line 121 logs every error unconditionally, but user cancellations are already logged at line 103 and crypto errors at lines 113-116. This results in duplicate log entries for recognized error types.
Consider moving the generic log to an
elsebranch or removing it for already-handled cases.🔧 Suggested fix
if (isKeychainCryptoError(error)) { const err = getKeychainErrorIdentity(error); console.error(`Keychain crypto error loading ${contextLabel}:`, { code: err?.code, name: err?.name, }); notifyKeychainFailure('crypto_failed'); + return; } - console.log(`Error loading ${contextLabel}:`, error); + // Log unrecognized errors only + console.warn(`Unhandled error loading ${contextLabel}:`, error); }🤖 Prompt for AI Agents