Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autofill: Increase ratio of complete credential saves #5386

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

CDRussell
Copy link
Member

@CDRussell CDRussell commented Dec 12, 2024

Task/Issue URL: https://app.asana.com/0/72649045549333/1206048666874234/f

Description

Increases the ratio of complete credential saves by being able to capture a username-only form submission, and then re-attach it to a nearby password-only form submission. This is useful for scenarios like resetting passwords and multi-step logins.

Steps to test this PR

DRAFT: test sites:

  • fill.dev / autofill.me
  • deviantart.com

Logcat filter: message~:"Partial save" message~:"Pixel sent: m_autofill_logins_update_password_inline" message~:"Determined that username" message~:"Determined that username”

Simulating a multi-step login form

  • Ensure no passwords currently saved (or none for autofill.me at least)
  • Visit https://autofill.me/form/login-simple
  • Enter username test
  • Leave password blank
  • Hit Login button
  • Now clear the username
  • Enter password (>=4 characters)
  • Hit Login button (which is submitting only a password now)
  • Save password when prompted, then go view it in the Password Management view (e.g., tap on View in snackbar)
  • Verify it has username=test and password matches what you provided (i.e., the username was backfilled because the partial form submission’s username was later applied to the final form submission which didn’t have the username)

Copy link
Member Author

CDRussell commented Dec 12, 2024

Comment on lines +82 to +91
internal data class AutofillStoreFormDataJsonRequest(
val credentials: AutofillStoreFormDataCredentialsJsonRequest?,
val trigger: FormSubmissionTriggerType?,
)

internal data class AutofillStoreFormDataCredentialsJsonRequest(
val username: String?,
val password: String?,
val autogenerated: Boolean = false,
)
Copy link
Member Author

@CDRussell CDRussell Dec 12, 2024

Choose a reason for hiding this comment

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

these are types specifically for Moshi / JSON parsing, used internally in this class. but we don’t necessarily want the same types returned out of this class

for example, the trigger is nullable when parsing from JSON, but when returning we also want that non-nullable and defaulting to UNKNOWN if it couldn’t be parsed from the JSON

@CDRussell CDRussell force-pushed the feature/craig/autofill_increase_ratio_complete_credential_saves branch 9 times, most recently from 9578c3a to 969ed0e Compare December 13, 2024 17:32
@CDRussell CDRussell force-pushed the feature/craig/autofill_increase_ratio_complete_credential_saves branch 6 times, most recently from b8badc8 to a36b674 Compare December 19, 2024 10:17
@CDRussell CDRussell force-pushed the feature/craig/autofill_increase_ratio_complete_credential_saves branch from a36b674 to 16e1970 Compare December 20, 2024 16:42
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.

1 participant