Repository navigation
fix(auth): rebuild app lock lifecycle handling - #6892
SeniorZhai wants to merge 2 commits into
Conversation
|
AI review done for Quality: Needs a fix before merge. Source review confirmed the early deep-link timeout fix and found a remaining PIN unlock issue during activity recreation. Runtime verification was blocked.
|
| return false | ||
| } | ||
| if (!isLocked && !foregroundChecked) { | ||
| foregroundChecked = true |
There was a problem hiding this comment.
A deep link handled entirely in onCreate can leave app lock disabled past its timeout. For example, a rejected WalletConnect link opened during the grace period sets foregroundChecked here, then finishes before onStart, so no onStop clears the flag. The next launch skips the timeout check. Keep the early deep-link check, but only mark the foreground session checked once an activity has started.
|
|
||
| private fun bindPinVerification(dialog: VerifyBottomSheetDialogFragment) { | ||
| dialog.setOnPinSuccess { | ||
| if (!lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) return@setOnPinSuccess |
There was a problem hiding this comment.
If PIN verification succeeds while the lock screen is stopped, this guard drops the unlock. The verification coroutine continues while stopped, so the PIN sheet still dismisses and shows “Successful,” but the user has to authenticate again. If unlocking must wait until the activity starts, defer applying the result and showing success until then.
| if (lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) { | ||
| applyPinSuccessUnlock() | ||
| } else { | ||
| pendingPinUnlock = true |
There was a problem hiding this comment.
If PIN verification succeeds after onSaveInstanceState, this updates only the current activity. The PIN sheet still dismisses and requests a success toast, but a recreated activity restores pendingPinUnlock = false from the earlier snapshot and asks for authentication again. Keep the verified result in an activity-scoped ViewModel that survives configuration changes, and show success when the unlock is applied.
No description provided.