fix: surface encrypted graph upload decrypt errors - #13146
Open
tiensonqin wants to merge 2 commits into
Open
Conversation
Treat WebCrypto OperationError during first encrypted upload as an invalid E2EE password instead of a silent RSA cache miss, and always show a UI notification when cloud graph create/upload fails. Co-authored-by: Tienson Qin <[email protected]>
Co-authored-by: Tienson Qin <[email protected]>
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.
Fixes encrypted first-upload in the web app failing with only a worker console log and no UI error (db-test#1128).
Problem
Uploading a local graph with encryption (
app.logseq: cloud icon → Use encryption → type password twice) failed silently. The worker logged:upload-graph!→<preflight-upload-e2ee!loads RSA material withgraph-idnil. A WebCryptoOperationErrorfromdecrypt-private-keywas treated as an RSA cache miss, retried, then rethrown without:db-sync/invalid-e2ee-password. The UI only notified for that code /decrypt-aes-key, so the user saw nothing.Change
OperationErroron the error, its message, and its cause (a truthy non-matching.namesuch asErrorno longer hides the cause).decrypt-private-keyfailures instead of resolving with anex-infovalue.decrypt-private-key/OperationErrorto:db-sync/invalid-e2ee-passwordafter the cache retry so the error is user-facing, not a silent cache miss.decrypt-private-keyandinvalid-e2ee-passwordas E2EE decrypt failures in the UI.Tests
graph-idnil +OperationErrorrejects with:db-sync/invalid-e2ee-password(one cache retry, not swallowed).decrypt-private-keyshows the wrong-password notification; other upload errors show the generic sync error.