Skip to content

tb and randompw#29165

Merged
chrisnojima merged 3 commits intonojima/HOTPOT-next-670-clean-2from
nojima/ZCLIENT-store-split-3
Apr 20, 2026
Merged

tb and randompw#29165
chrisnojima merged 3 commits intonojima/HOTPOT-next-670-clean-2from
nojima/ZCLIENT-store-split-3

Conversation

@chrisnojima-zoom
Copy link
Copy Markdown
Contributor

No description provided.

This comment was marked as outdated.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 39 to 56
@@ -50,7 +51,7 @@ const DeleteConfirm = () => {
// dont do this in a preflight test
return
}
if (Kb.Styles.isMobile && hasPassword) {
if (needsMobilePassphraseCheck) {
navigateAppend({name: 'checkPassphraseBeforeDeleteAccount', params: {}})
} else {
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On mobile, needsMobilePassphraseCheck treats randomPW === undefined the same as "has a password" and routes to checkPassphraseBeforeDeleteAccount. If the account actually has a random passphrase (no password) but the RPC hasn’t returned yet (or failed), this flow blocks deletion behind a password prompt the user can’t satisfy. Consider gating the passphrase-check route only when randomPW === false (known to have a password), and disabling/deactivating the confirm action while randomPW is still undefined (or forcing a reload and waiting) so you don’t guess wrong.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +37
const reload = React.useCallback(() => {
const version = requestVersionRef.current + 1
requestVersionRef.current = version

const load = async () => {
try {
const passphraseState = await T.RPCGen.userLoadPassphraseStateRpcPromise()
if (requestVersionRef.current !== version) {
return
}
setRandomPW(isRandomPassphraseState(passphraseState))
} catch (error) {
if (!(error instanceof RPCError)) {
return
}
if (requestVersionRef.current !== version) {
return
}
logger.warn('Error loading hasRandomPW:', error.message)
}
}

ignorePromise(load())
}, [])
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reload() can still call setRandomPW(...) after the component using this hook has unmounted (nothing cancels/guards the in-flight RPC). Elsewhere in the repo, async RPC-driven state updates are typically guarded with a mountedRef (or equivalent) to avoid setting state on an unmounted component (e.g. shared/people/container.tsx uses mountedRef.current checks). Consider adding an unmount guard (or abort/cancel pattern) so setRandomPW only runs while mounted.

Copilot uses AI. Check for mistakes.
@chrisnojima chrisnojima merged commit c8fdcf8 into nojima/HOTPOT-next-670-clean-2 Apr 20, 2026
4 of 5 checks passed
@chrisnojima chrisnojima deleted the nojima/ZCLIENT-store-split-3 branch April 20, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants