[Form Autofill] Add a pref to determine whether a user has ever used credit card autofill

RESOLVED FIXED in Firefox 58

Status

()

enhancement
P5
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: lchang, Assigned: lchang)

Tracking

(Blocks 1 bug)

Trunk
mozilla58
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox58 fixed)

Details

(Whiteboard: [form autofill:MVP])

Attachments

(1 attachment)

We need a pref to distinguish the users who are supposed to know what Credit Card Autofill is from others for Heartbeat Survey.
Assignee

Updated

2 years ago
Summary: [Form Autofill] Add a pref to distinguish the users who have seen the credit card doorhanger from others → [Form Autofill] Add a pref to determine whether a user has ever used credit card autofill
Assignee

Updated

2 years ago
Status: NEW → ASSIGNED
Using a pref mimics what we did for addresses but was really a poor axproximation for what we actually want to know: did the user use the feature. I think what we really want is to know that a user has actually autofilled a CC number.

Ideally heartbeat would query the storage metadata but we never found out how hard that would be. The workaround was to use a pref.
I have no idea how to query the storage metadata directly, either.

Since the credit card "firstTimeUse" pref will be used only for heartbeat survey, I think we can set the pref only when a user submit an autofill'ed form. However, after discussing with Cindy, she said that it would be better that we can also survey those users once see the doorhander but choose not to save a credit card (or even "Never Save"). Therefore, I wrote the patch to set the pref when following two conditions happen:

  - User submits an autofill'ed form (no matter it triggers doorhanger or not)
  - User sees the doorhanger (no matter which button the user clicks)
BTW, the first condition is needed because there is a chance that a user creates a credit card profile in preferences directly without seeing any doorhanger.

Comment 5

2 years ago
mozreview-review
Comment on attachment 8924931 [details]
Bug 1414189 - [Form Autofill] Add a pref to determine whether a user has ever used credit card autofill.

https://reviewboard.mozilla.org/r/196200/#review202844

::: browser/extensions/formautofill/FormAutofillParent.jsm:432
(Diff revision 1)
>        }
>      }
>    },
>  
>    async _onCreditCardSubmit(creditCard, target, timeStartedFillingMS) {
> +    // Consider a user has ever used credit card autofill feature if:

What if user adds a credit card through preferences and submits the same card manually from website? It doesn't match these 2 conditions but pref will still be set. Here it looks like we'll set the pref to true if user submit a valid credit card from website no matter the doorhanger is displayed or not.
Comment hidden (mozreview-request)
Component: Form Manager → Form Autofill
(In reply to Steve Chung [:steveck] from comment #5)
> What if user adds a credit card through preferences and submits the same
> card manually from website? It doesn't match these 2 conditions but pref
> will still be set. Here it looks like we'll set the pref to true if user
> submit a valid credit card from website no matter the doorhanger is
> displayed or not.

After discussing with Cindy, we agreed to also mark users who neither see the doorhanger nor use autofill but somehow already have profiles in the storage. We may need a way to distinguish these three different user groups, so I changed the pref name to "extensions.formautofill.creditCards.heartbeat" whose valid value could be:

0: none,
1: submitted a manually-filled credit card form (but didn't see the doorhanger because of a duplicate profile in the storage)
2: saw the doorhanger
3: submitted an autofill'ed credit card form

Patch has been updated accordingly.
Comment hidden (mozreview-request)

Comment 9

2 years ago
mozreview-review
Comment on attachment 8924931 [details]
Bug 1414189 - [Form Autofill] Add a pref to determine whether a user has ever used credit card autofill.

https://reviewboard.mozilla.org/r/196200/#review203242

::: browser/extensions/formautofill/FormAutofillParent.jsm:433
(Diff revision 3)
>      }
>    },
>  
>    async _onCreditCardSubmit(creditCard, target, timeStartedFillingMS) {
> +    if (creditCard.guid) {
> +      if (FormAutofillUtils.AutofillCreditCardsUsedStatus < 3) {

nit: I think this can move to the following `if (creditCard.guid)` condition and wrap the `if (FormAutofillUtils.AutofillCreditCardsUsedStatus < #)` as an inline function or private function since the reason is the same(only overwrite the smaller number).
Attachment #8924931 - Flags: review?(schung) → review+
Comment hidden (mozreview-request)
Thanks.

Comment 12

2 years ago
We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again.

hg error in cmd: hg rebase -s af58a557435d -d 5da4fb949bd2: rebasing 433023:af58a557435d "Bug 1414189 - [Form Autofill] Add a pref to determine whether a user has ever used credit card autofill. r=steveck" (tip)
merging browser/extensions/formautofill/FormAutofillParent.jsm
merging browser/extensions/formautofill/test/browser/browser_creditCard_doorhanger.js
warning: conflicts while merging browser/extensions/formautofill/FormAutofillParent.jsm! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
Comment hidden (mozreview-request)

Comment 14

2 years ago
Pushed by lchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/684399524849
[Form Autofill] Add a pref to determine whether a user has ever used credit card autofill. r=steveck

Comment 15

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/684399524849
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.