Repository navigation
fix(web): a private create with no encryption key stops asking for an unlock - #692
Merged
Merged
Conversation
… unlock On a reloaded (locked) tab, picking Private on /new with no encryption key stored in this browser showed both "Unlock to create a private repo" and "cannot create a private repository: your identity has no encryption key in this browser". Unlocking can't help when no key is stored, so only the Settings pointer is shown now. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
commented
Nov 24, 2026
PastaPastaPasta
left a comment
Owner
Author
There was a problem hiding this comment.
Verdict: approve
Reviewed 961acf1.
- Fix is right.
noKeyis true only when Private is chosen andencryptionOpsreturnednull, which means a successful read found no stored key.storedEncryptionKeyIds(vault.ts:1614) can be read while the tab is locked, and a resumed signing-only session still counts its own vault blob. Sonullon a locked tab really means there's no key, and unlocking can't help. With the fix the passphrase box goes away,private-no-keystays, and Create is blocked by the "Add your encryption key…" reason. - Locked tab with a stored key still asks for the unlock. In that case
ops.datais non-null, sonoKeyis false andneedsUnlockis unchanged. The same goes for a read that is still loading or that failed:keyMissingneedssettled && error === null, so the unlock prompt still shows. The browser teste2e/session-persistence.spec.ts:159-165(Private, thennew-private-unlock) covers the stored-key case. - No regressions on public creates or wallet/phrase sessions.
noKeyis gated onisPrivate. A public create with members-only content already dropped out throughwithMembers = … && !keyMissing, so the new!noKeychanges nothing there. Wallet and phrase sessions haveunlockScope !== 'signing', soneedsUnlockwas already false. - The test fails without the fix. Under the old code,
unlockScope='signing'withheld=nullmakesneedsUnlocktrue, which rendersnew-private-unlock, and the Create title becomes "Unlock this tab…". So bothtoBeNull()and the/Add your encryption key/match would fail. Reasoned from the code, not run: no local vitest on this box, and thewebjob is still pending. - Nit, not blocking: a matching unit test for "locked, key stored, Private: unlock shown" would keep this rule in the unit suite and not rely only on browser coverage.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
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.
On a reloaded (locked) tab with no encryption key stored in the browser, choosing Private on
/newshows two messages that contradict each other: an "Unlock to create a private repo" passphrase box, and "cannot create a private repository: your identity has no encryption key in this browser. Add it in Settings". Unlocking can never help here, becauseencryptionOpsreads the stored key ids without an unlock and returnednull. A user who follows the first prompt unlocks and is still blocked.Found in tonight's mainnet-readiness web QA on forge.dashhq.org (MAINTAINER signed in with an identity file, without ticking "Read and write members-only and private content").
Fix:
needsUnlockis false when no key is stored (noKey), so only the Settings pointer shows and Create stays disabled with "Add your encryption key…". A locked tab that does hold a key still asks for the unlock, whiche2e/session-persistence.spec.tscovers.Test:
app/new/page.test.tsxhas a new case (locked tab, no key, Private). It fails before the change and passes after; the whole file passes (9/9) andtsc --noEmitis clean.🤖 Generated with Claude Code