keepassium / KeePassium

KeePass-compatible password manager for iOS
https://keepassium.com
Other
1.19k stars 104 forks source link

Sometimes keyboard does not show up in AutoFill on iOS 14 #133

Closed rao-g closed 3 years ago

rao-g commented 4 years ago

Describe the bug The keyboard on the autofill does not come up when you use KeyPassium autofill for the second time.

To Reproduce Steps to reproduce the behaviour:

  1. Set an autofill database.
  2. Go to a password input screen app or browser.
  3. Select the Password autofill option above the keyboard.
  4. the autofill KeePassium option comes up and the keyboard as well for searching.
  5. select the option
  6. The username and password are filled in.
  7. Use another app/website to login.
  8. Select the Password autofill option above the keyboard.
  9. this time the autofill KeePassium screen comes up but not the keyboard. The keyboard does not even appear after clicking the search icon or focusing on the search box.

Expected behaviour The keyboard should appear when the autofill screen appears. And also after the search icon is pressed or the search box is focused.

Screenshots If applicable, add screenshots to help explain your problem.

User Information (please complete the following information):

Additional context Add any other context about the problem here.

keepassium commented 4 years ago

Hi @gauravraosahab, thank you for documenting this!

It's a known issue on iOS 14. I tend to think this is a system bug, especially since there are other keyboard-related bugs on iOS 14.

Unfortunately, I cannot reproduce it on my phone with iOS 14.0.1... So the issue seems dependent on device settings and I guess keyboard layouts is the primary suspect. Can you please open device settings → General → Keyboards → Keyboards, and tell me which keyboards you have?

Another hypothesis, from what I've seen somewhere in the net: the keyboard might be there, but invisible. Try to tap where the keyboard should have been, and check if this produces any text.

rao-g commented 4 years ago

Hi

I have attached the screenshot of the keyboard setting. I have only the default keyboard selected.

I tried to tap at the bottom side of the screen when keyboard appears and the KeePassium selected the entry located there and no keyboard buttons pressed.

Is it possible to enforce keyboard come up when search box is focused in?

On Thu, Oct 29, 2020 at 6:55 PM KeePassium notifications@github.com wrote:

Hi @gauravraosahab https://github.com/gauravraosahab, thank you for documenting this!

It's a known issue https://developer.apple.com/forums/thread/654499 on iOS 14. I tend to think this is a system bug, especially since there are other keyboard-related bugs https://github.com/keepassium/KeePassium/issues/127#issuecomment-700110633 on iOS 14.

Unfortunately, I cannot reproduce it on my phone with iOS 14.0.1... So the issue seems dependent on device settings and I guess keyboard layouts is the primary suspect. Can you please open device settings → General → Keyboards → Keyboards, and tell me which keyboards you have?

Another hypothesis, from what I've seen somewhere in the net: the keyboard might be there, but invisible. Try to tap where the keyboard should have been, and check if this produces any text.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keepassium/KeePassium/issues/133#issuecomment-719046641, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6CJXJD4ILIFXWFV5RLMTSNHQEVANCNFSM4TD5RL6Q .

-- Cheers GR Sent from Gmail Mobile

keepassium commented 4 years ago

It seems the attachment did not work out via email.

Is it possible to enforce keyboard come up when search box is focused in?

As far as I know, there is no way to force-show the keyboard. Because normally it appears automatically whenever needed...

keepassium commented 3 years ago

I can reproduce the issue by cancelling the biometric prompt in AutoFill. After I tap "Use Passcode" in Touch ID/Face ID prompt, AutoFill requires entering the AppLock passcode. The UI moves up to to accommodate the keyboard (which means the system does send notifications that the keyboard is appearing). But there is no keyboard visible, nor any reaction to taps in the keyboard area. It seems like keyboard gets lost behind the main window...

If Touch ID/Face ID is disabled in app settings, the keyboard seems to appear reliably.

rao-g commented 3 years ago

But, strangely, it works for the first time, but not after that. Although I think the passcode would be asked on each access.

keepassium commented 3 years ago

I think the passcode would be asked on each access.

Is your database lock timeout short enough? (settings → Data Protection → Database Timeout)

liwangdong commented 3 years ago

I have the same problem. Device: iPhone X OS: IOS 14.1 App Version: v1.19.76

0xC4N1 commented 3 years ago

If Touch ID/Face ID is disabled in app settings, the keyboard seems to appear reliably.

Confirmed. Works with app code but not with Face ID. Also noticed when access protection has a delay of 15 or more seconds the keyboard works when you switch from Keepassium to another app and using AutoFill within the delay.

Device: iPhone 12 mini OS: iOS 14.2 App Version: v1.19.76

keepassium commented 3 years ago

Can anyone please try the latest beta (~1.20.79~ Fixed typo: 1.20.78) and check if the issue remains there?

rao-g commented 3 years ago

How to test auto fill using this beta? I imagine this opens the app within the test flight app.

On Sat, Nov 14, 2020 at 5:20 PM KeePassium notifications@github.com wrote:

Can anyone please try the latest beta https://keepassium.com/beta (1.20.79) and check if the issue remains there?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/keepassium/KeePassium/issues/133#issuecomment-727266925, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6CJQKPLDHQAXXZDDJHWLSP3YBJANCNFSM4TD5RL6Q .

-- Cheers GR Sent from Gmail Mobile

keepassium commented 3 years ago

How to test auto fill using this beta? I imagine this opens the app within the test flight app.

Install TestFlight app, open the beta link in Safari and tap "Open in the TestFlight app" at the top of the page. In TestFlight, you will have a button to install KeePassium beta. It replaces the AppStore version, but keeps all the files and settings.

So the next time you open AutoFill, it should be the one from the beta.

rao-g commented 3 years ago

I tried the app v 1.28.78 beta. This time the keyboard doesn't work even for the first time.(It used to work)

On Sat, Nov 14, 2020 at 6:11 PM KeePassium notifications@github.com wrote:

How to test auto fill using this beta? I imagine this opens the app within the test flight app.

Install TestFlight app, open the beta link https://keepassium.com/beta in Safari and tap "Open in the TestFlight app" at the top of the page. In TestFlight, you will have a button to install KeePassium beta. It replaces the AppStore version, but keeps all the files and settings.

So the next time you open AutoFill, it should be the one from the beta.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/keepassium/KeePassium/issues/133#issuecomment-727272256, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6CJQQDW2Q53S7GHZJPZDSP36BRANCNFSM4TD5RL6Q .

-- Cheers GR Sent from Gmail Mobile

Notfound99k commented 3 years ago

Same problem. Device: iPhone 11 OS: IOS 14.2 App Version: 1.19

keepassium commented 3 years ago

If Touch ID/Face ID is disabled in app settings, the keyboard seems to appear reliably.

Confirmed. Works with app code but not with Face ID.

Thanks, @0xC4N1. Can you please check if the beta fixes the issue as well?

@gauravraosahab, thanks for testing. (I had a typo in version number, it is indeed 1.20.78.)

1) Do you have Face ID check before AutoFill? 2) Do you have English keyboard as the default one? (iOS 14 seems to struggle with some layouts.)

rao-g commented 3 years ago
  1. Do you have Face ID check before AutoFill? YES
  2. Do you have English keyboard as the default one? (iOS 14 [seems to struggle] YES
0xC4N1 commented 3 years ago

I wasn't able to test the beta with Testflight yet. However I've noticed that this behavior doesn't apply to all apps. For example the keyboard is visible when I use AutoFill in Safari and Terimus but not in Firefox and Amazon.

magebarf commented 3 years ago

On 1.20.78 and still seeing the missing keyboard, normally on the first invocation of AutoFill, while second attempt (after backing out through Databases -> Cancel in the top menu) usually shows the keyboard. Face ID enabled: Yes English keyboard as default: No, swedish

keepassium commented 3 years ago

Thanks for the input, everyone!

So, I have just finished over 300 AutoFill tests in different settings:

Not every combination was tested, but every tested configuration was tested 10-15 times to gather some stats (since the issue seems to occur sporadically). After each AutoFill invocation, I force-quit and relaunched the browser. After changing any experimental parameter, I have rebooted the phone, so that all tests run from the same initial state.

Findings

@gauravraosahab, @liwangdong, @0xC4N1, @magebarf — can you please report what is your default/current web browser? And while we are at it, does AutoFill works properly in Safari for you?

rao-g commented 3 years ago

I am using DuckDuckGo as the default browser. I am getting issues when auto filling in apps (like banking apps, social media) and when I am using in any browser(safari, edge, chrome or DuckDuckGo).

magebarf commented 3 years ago

I am running Safari for 100% of my browsing on the iPhone, but I am on the other hand uncertain if the occasions where I've seen it is from within a web browser or from an App (I'd say in a normal day it's probably 70/30 ratio between App logins/Safari AutoFill).

Next time I have the same thing happen, I'm taking proper notes!

keepassium commented 3 years ago

I am using DuckDuckGo as the default browser. I am getting issues when auto filling in apps (like banking apps, social media) and when I am using in any browser(safari, edge, chrome or DuckDuckGo).

I am running Safari for 100% of my browsing on the iPhone, but I am on the other hand uncertain if the occasions where I've seen it is from within a web browser or from an App (I'd say in a normal day it's probably 70/30 ratio between App logins/Safari AutoFill).

Ok, if you see the issue in Safari with 1.20.78, then I am still missing something... Any ideas how to reliably reproduce the problem are welcome.

rao-g commented 3 years ago

I have changed by default browser to Safari, and then restarted by phone. After turning on, I see the same consistent behavior.

For the first time, Autofill uses face id to access the database and on entry screen I can see the keyboard. I select an entry on it and the fields are populated. Then I reselect the password field and the keyboard pops up and I select “Passwords” to autofill. The auto fill verifies using the Face ID and I see the entries screen without any keyboard. Then I try selecting the search field on the top, it sill does not show the keyboard.

I tried it five times and see the same issue. I am not sure what other information can I provide to help you reproduce the issue.

Keyboard – default English, no other keyboards installed. Also, prior to updating to IOS 14 this was not an issue. 

magebarf commented 3 years ago

Since last update, the only place I've seen the behavior is from within an App, and from that it's the reverse from original post that it does not show up on first invocation but it does on the second.

Changing the AppLock (used with FaceID) to the 3 second setting seems to ensure that it will stop showing up the majority of times but not with 100% rate (more like 80-90% or so).

Still have not seen it while using Safari, no matter the AppLock timeout settings.

rao-g commented 3 years ago

My app lock setting is immediate.

On Sat, Nov 21, 2020 at 6:36 PM Patrik Thunström notifications@github.com wrote:

Since last update, the only place I've seen the behavior is from within an App, and from that it's the reverse from original post that it does not show up on first invocation but it does on the second.

Changing the AppLock (used with FaceID) to the 3 second setting seems to ensure that it will stop showing up the majority of times but not with 100% rate (more like 80-90% or so).

Still have not seen it while using Safari, no matter the AppLock timeout settings.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keepassium/KeePassium/issues/133#issuecomment-731646989, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6CJS25UYLEV5DHMSD66DSRA6HFANCNFSM4TD5RL6Q .

-- Cheers GR Sent from Gmail Mobile

keepassium commented 3 years ago

Somewhat good news: I can reliably reproduce the issue if AutoFill delays showing the keyboard. That is, if a text field is not focused as soon as possible, the keyboard will likely not show up at all.

Of course, breaking the thing is the exact opposite of solving the problem. But reproducing the issue reliably is already a breakthrough, so this is good news.

rao-g commented 3 years ago

Great news!

Just to add on, even if I try to focus on the search box, the keyboard doesn’t show up.

On Tue, Nov 24, 2020 at 11:31 AM KeePassium notifications@github.com wrote:

Somewhat good news: I can reliably reproduce the issue if AutoFill delays showing the keyboard. That is, if a text field is not focused as soon as possible, the keyboard will likely not show up at all.

Of course, breaking the thing is the exact opposite of solving the problem. But reproducing the issue reliably is already a breakthrough, so this is good news.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keepassium/KeePassium/issues/133#issuecomment-733050092, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6CJRVEU3NDVABRLVCAR3SRPGUJANCNFSM4TD5RL6Q .

-- Cheers GR Sent from Gmail Mobile

keepassium commented 3 years ago

Still struggling to find the cause...

For what it's worth, other password managers experience the same issue on iOS 14: https://github.com/bitwarden/mobile/issues/1114 https://github.com/mssun/passforios/issues/412

keepassium commented 3 years ago

Good news, I think I have figured it out.

The problem happens when AutoFill shows TouchID/FaceID prompt before showing the keyboard. These processes run in different threads, which explains the sporadic nature of the problem. After I delayed the biometric prompt by 200 ms, the keyboard shows up every single time (20 tests in Firefox had 100% success rate).

I will submit this with the next beta early next week (would like to refine a few other things over the weekend).

rao-g commented 3 years ago

Awesome, thanks!

On Sat, Nov 28, 2020 at 3:54 PM KeePassium notifications@github.com wrote:

Good news, I think I have figured it out.

The problem happens when AutoFill shows TouchID/FaceID prompt before showing the keyboard. These processes run in different threads, which explains the sporadic nature of the problem. After I delayed the biometric prompt by 200 ms, the keyboard shows up every single time (20 tests in Firefox had 100% success rate).

I will submit this with the next beta early next week (would like to refine a few other things over the weekend).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keepassium/KeePassium/issues/133#issuecomment-735283081, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6CJWHQSEVBMPEU2CPF5LSSFIOJANCNFSM4TD5RL6Q .

-- Cheers GR Sent from Gmail Mobile

0xC4N1 commented 3 years ago

I can confirm since v1.20.78 the keyboard is invisible only the first time AutoFill is used in Firefox. Switching back to Firefox and using AutoFill again will make the keyboard visible. Thank you so much for working on this!

0xC4N1 commented 3 years ago

Bad news: it is happening again. No keyboard appearing. Maybe the thing that made it work for a while was actually the app restart during update? Rebooting doesn’t have the same effect though. Only thing I’ve changed is switching to KeePassium Pro after the keyboard started working with Firefox and KeePassium basic. It worked for a while and after a day or two it stopped working. KeePassium Pro is still at 1.19.76.

keepassium commented 3 years ago

@0xC4N1, thanks for the update. The problem is to be expected in KeePassium Pro v1.19.76 — after all, this is the version for which this issue was originally reported. v1.20.78 changed the behavior slightly.

The fix I announced here is still not published. I planned to submit it to beta on Tuesday, but 2020 laughs at any planning attempts...

keepassium commented 3 years ago

Can anyone confirm whether the issue still remains in v1.21.81? (it's both in TestFlight and on the App Store)

I have tested on iOS 14.4, and keyboard was frequently missing in 1.20.78 but showed up properly in 1.21.81. But since this is a heisenbug, I would appreciate additional validation :)

rao-g commented 3 years ago

I am still seeing the issue in iOS 14.3 and v 1.21.81. I will be updating to IOS 14.4 shortly and I will try again then.

On Sun, Jan 31, 2021 at 7:19 PM KeePassium notifications@github.com wrote:

Can anyone confirm whether the issue still remains in v1.21.81? (it's both in TestFlight and on the App Store)

I have tested on iOS 14.4, and keyboard was frequently missing in 1.20.78 but showed up properly in 1.21.81. But since this is a heisenbug, I would appreciate additional validation :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/keepassium/KeePassium/issues/133#issuecomment-770469795, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ6CJSIX334HXUI64X6WELS4XQQ3ANCNFSM4TD5RL6Q .

-- Cheers GR Sent from Gmail Mobile

0xC4N1 commented 3 years ago

Can anyone confirm whether the issue still remains in v1.21.81? (it's both in TestFlight and on the App Store)

It isn’t gone yet but I see improvement with v1.21.81. Now I don’t need to go back to Firefox and open AutoFill again. Instead it is enough to go back to database selection and select the default database again to make the keyboard appear.

keepassium commented 3 years ago

@0xC4N1 , thanks. It's a relief already. I'll see if I can fix it further.

magebarf commented 3 years ago

Not sure if my experience is individual (@0xC4N1's comment seems to point to similarities) , but I believe one huge improvement with the more recent versions is that if you get to the stage where you end up without a keyboard, you can "restore it" by going into the keyfile dialog and backing out.

If memory serves right, previously this did not bring back the keyboard as it does for me now.

keepassium commented 3 years ago

@magebarf , yep, I can reproduce this. And since "the fix" occurs fully within AutoFill's own view hierarchy (no system-managed overlays), it might be easier to debug. I will look into this.

keepassium commented 3 years ago

Well, this is getting ridiculous beyond frustrating...

The last time the keyboard 1) did not appear when it should have, and then 2) appeared after switching to the key file dialog and backing out.

Today, I cannot reproduce even step 1. Safari, Firefox, DuckDuckGo, any form, even after restart — keyboard appears as if there never was a problem.

Heisenbugs 👻 are the worst. </rant> </statusUpdate>

magebarf commented 3 years ago

They're up there with schrödingbugs at least. 😀 But are you sure what we're looking at is not a mandelbug? I think we all agree that this is within Apple's APIs, but this always feels applicable in this type of hunt: https://xkcd.com/1739/

On a more serious note; Agree with your observations here, the number of occurrences of the bug has definitely gone down recently. Can't recall exactly when I observed it the last time. I wonder if the 14.4.1 update improved a few things behind the scenes?

0xC4N1 commented 3 years ago

Hm strange I can reproduce it reliably in Firefox with iOS 14.4.1 on iPhone 12 mini. On my iPhone 5s it worked for the first time today in Firefox.

magebarf commented 3 years ago

Also can concur, had the first occurrence I can remember for a few weeks yesterday on iOS 14.4.1.

I still would claim the probability/number of observations has been reduced, but as @0xC4N1 confirmed, still present in latest stable iOS release as of this moment.

keepassium commented 3 years ago

@magebarf, @0xC4N1, thanks. I will keep trying to reproduce it...

Pit-Storm commented 3 years ago

Maybe I can add some value to this discussion.

At my device the bug happend after I hadn‘t used the autofill feature for a while )days). I wanted to login with a entry I added on anthoer device. But it wasn‘t synched properly, because I hafn‘t started the storage app for a while and also hafn‘t used keepassium for a while.

So the dialogue showed up, couldn‘t find an entry. Therefore I wanted to tap the sesrchbox. No keyboard.

as I synched the database with the new entry, it could find the entry, automatically select it. No need for a keyboard.

I was logging into the preply App. Using German as the default keyboard. My Backend config is with nextcloud sync.

iOS v14.4 iPhone 11 Pro Keepassium v1.23.85

Hoping that this could help 🙂

keepassium commented 3 years ago

Thank you, @Pit-Storm. The main challenge is how to reproduce the issue reliably or at least with a high success (failure?) rate. (Success means keyboard's failure to show up, so terminology gets a bit confusing :)

keepassium commented 3 years ago

Ok, I am 95% sure it is really fixed this time. The beta version is already in TestFlight. If the issue reoccurs, feel free to reopen.

(If somebody stumbles on this looking for the solution, the key part was this line based on a very old workaround that makes the keyboard appear more promptly. Plus, becomeFirstResponder should be called after biometric prompt has finished disappearing. If called during the animation, the keyboard will remain invisible.)