Closed Bug 1770010 Opened 2 years ago Closed 2 years ago

[Bug]: Autofill fails, when I need to unlock bitwarden.

Categories

(GeckoView :: General, defect, P1)

Unspecified
Android

Tracking

(firefox-esr91 unaffected, firefox100 wontfix, firefox101 wontfix, firefox102 fixed)

VERIFIED FIXED
102 Branch
Tracking Status
firefox-esr91 --- unaffected
firefox100 --- wontfix
firefox101 --- wontfix
firefox102 --- fixed

People

(Reporter: agi, Assigned: agi)

References

Details

(Whiteboard: [geckoview:m102])

Attachments

(1 file)

From github: https://github.com/mozilla-mobile/fenix/issues/25269.

Steps to reproduce

  1. Be sure your Android Bitwarden app is locked *and killed. (i.e. If you open the app, it should prompt you for master password or biometric auth; if it does so, that's good -- leave it in that state, and kill the app by swiping it offscreen from your app-switcher UI). In the event you've unlocked it, lock it via its "Settings|Lock Now" button, and then kill the app.
  2. In Fenix, visit some site where Bitwarden has a saved login that you could use, e.g. in my case I'm using https://wiki.mozilla.org/index.php?title=Special:UserLogin
  3. Tap the website's username field
  4. Keyboard will appear, with a "Bitwarden Vault is locked" button at the top. Tap that button.
  5. Authenticate with Bitwarden. It will probably then say "Items for mozilla.org" (or whatever site you're on).
  6. Tap its entry for the credentials that you want to use. (This makes Bitwarden disappear and Firefox becomes foreground again.)

Expected behaviour

The username/password field should have been filled in.
Also, my keyboard should have buttons for the various matching logins in Bitwarden, now that I've unlocked it. (This is what happens if I reload at this point and focus the username or password field, i.e. if I perform the STR with Bitwarden already focused.)

Actual behaviour

The username field is still empty.
The password field has gained focus, but is also empty.
My keyboard does not have any Bitwarden buttons anymore.

Device name

Google Pixel 4a

Android version

Android 12

Firefox release type

Firefox Nightly

Firefox version

102.0a1

Device logs

No response

Additional information

Note that in Bitwarden settings, under "Auto-fill Services", I have every option enabled.

Change performed by the Move to Bugzilla add-on.

The android autofill framework requests a virtual structure for the webpage in
onProvideAutofillVirtualStructure and then at a later time will call autofill
when the user selects a value in the autofill app.

These method calls happen on the GeckoView, but our data is stored in the
GeckoSession (or rather, in the window that the GeckoSession represents).

Because of the asynchronicity of this process, we're not guaranteed that the
app hasn't switched the sesssion behind us in between the
onProvideAutofillVirtualStructure and autofill call, so we need to keep a
reference to the current autofill session when onProvide is called so that
we're sure that we are autofilling the right session.

We use a WeakReference to avoid keeping a window alive more than necessary, as
if the window is unloaded, there is no point in autofilling anyway.

Assignee: nobody → agi
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P1
Whiteboard: [geckoview:m102]
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b295eef81c68
Keep reference to autofill session instead of using mSession. r=jonalmeida,calu
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch

Hello,
This issue is verified fixed, it can no longer be reproduced on the latest Nightly 102.0a1 from 05/24 with Google Pixel 6 (Android 12) and Xiaomi Redmi Note 8T (Android 9).

Verified as per Comment 5.

Status: RESOLVED → VERIFIED

I tested latest Nightly, and this seems to be fixed for me, too (I'm the original reporter from https://github.com/mozilla-mobile/fenix/issues/25269 )

Thanks!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: