Skip to content

Fix slow unlock on iOS by disabling privacy screen immediately#9884

Open
brian-c11 wants to merge 1 commit intoente-io:mainfrom
brian-c11:fix/auth-ios-slow-unlock
Open

Fix slow unlock on iOS by disabling privacy screen immediately#9884
brian-c11 wants to merge 1 commit intoente-io:mainfrom
brian-c11:fix/auth-ios-slow-unlock

Conversation

@brian-c11
Copy link
Copy Markdown

Description

Fix slow unlock on iOS when using Face ID (device lock). The blur/privacy screen was persisting briefly after successful authentication before showing the codes.

Changes

  • Added await PrivacyScreen.instance.disable() immediately after successful authentication in _showLockScreen(), before calling didUnlock()
  • This immediately removes the blur overlay instead of waiting for the lock screen navigation to complete

Issue

Fixes #4749

Testing

  • Tested on iOS with Face ID enabled as device lock
  • Verified that codes appear immediately when keyboard pops up with "Focus search on app start" option enabled

Screenshots

Before: Noticeable delay between Face ID success and codes appearing
After: Codes appear instantly when keyboard pops up

Fix slow unlock on iOS by disabling the privacy/blur screen immediately
after Face ID authentication succeeds instead of waiting for the lock
screen to be popped.

Before: The blur overlay persisted briefly after successful authentication,
causing a noticeable delay before showing the codes.

After: Call PrivacyScreen.instance.disable() right after authentication
succeeds, before calling didUnlock(), to immediately remove the blur.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d68e2b2ed0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

_isShowingLockScreen = false;
if (result) {
lastAuthenticatingTime = DateTime.now().millisecondsSinceEpoch;
await PrivacyScreen.instance.disable();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep privacy protection enabled after unlock

Calling PrivacyScreen.instance.disable() on every successful unlock turns off the privacy-screen feature globally, but this flow never re-enables it. LockScreenSettings only enables privacy mode from saved preferences during setup, so users with hide-app-content enabled lose app-switcher/screenshot protection after their first unlock until they restart or manually toggle the setting.

Useful? React with 👍 / 👎.

_isShowingLockScreen = false;
if (result) {
lastAuthenticatingTime = DateTime.now().millisecondsSinceEpoch;
await PrivacyScreen.instance.disable();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Guard privacy-screen disable on desktop unlocks

This unconditional disable() call runs on all platforms, but elsewhere desktop is explicitly excluded from privacy-screen operations. In desktop environments where privacy_screen lacks an implementation, disable() can throw; because it is awaited before didUnlock(), the catch path logs and exits without unlocking, leaving users on the lock screen even after successful authentication.

Useful? React with 👍 / 👎.

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.

Ente Auth iOS: slow unlock

3 participants