Run the credit card migration dry run in Nightly
Categories
(Toolkit :: Form Autofill, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: dimi, Assigned: dimi)
References
(Blocks 1 open bug)
Details
Attachments
(3 external files)
Copy the profile's credit cards into the Rust store, verify them field by field, report the result through migrate_to_rust, and wipe the copy again. Nothing reads from Rust: creditCards.storage.rust.enabled stays off, which is what the measurement is meant to inform. Once per profile per generation, recorded on migrationTestVersion.
| Assignee | ||
Comment 1•2 months ago
|
||
The credit card counterpart of Bug 2069236: copy the profile's cards into the
Rust store, verify them field by field, report through migrate_to_rust, and wipe
the copy again, once per profile per generation.
Cards are encrypted, which is the difference. The copy needs a key at each end
and a dry run is measurement nobody asked for, so it must prompt for neither,
and #creditCardDryRunAllowed asks after both. #primaryPasswordUnlocked reports
whether NSS will hand its key over and never logs the token in;
enabled pref asked for. OSKeyStore.isLoggedIn answers the same for the other
end -- it is false until something has used that store successfully, so a
profile measures only once it has proved the key works for a reason of its own
-- and isUIBusy keeps the measurement off the back of a dialog already up.
Both answers are this moment's. A key locked afterwards is not guarded against,
LoginHelper.requestReauth logging the token out deliberately, nor is a keychain
the OS locks underneath us.
The copy the enabled pref asks for waits on the same terms rather than logging
the token in. A dialog there sits inside the switch that every later flip queues
behind -- including the flip back that undoes the one being answered -- and
waiting for input is the blocking, so there is no way to keep the prompt and
free the chain. It defers to an unlock instead, which is the other half of what
LoginStorageMigrator does, and the observer that retries the measurement retries
the copy with it.
A skipped profile keeps its generation, so it can be measured later without a
restart. isLoggedIn is per session, so the startup pass measures nothing on a
profile that has not touched a card yet; formautofill-storage-changed is the
second chance, handling a card being what unlocks that store. With
passwordmgr-crypto-login -- the deferral LoginStorageMigrator makes, on the same
topic -- that is a trigger for each key. A profile with nothing owed pays only
registration is tracked by a flag of its own rather than by #initPromise, which
is set before the observers are and stays set if the chain rejects, and
nsIObserverService throws on removing one it does not hold.
The dry run is a path of its own rather than a flag through the real one, which
was deciding twice what it was doing.
The dialog is NSS's own, so the tests mock it at the nsIPrompt level as
test_crypto_SDR_primary_password.js does, and assert that nothing was shown
rather than only that nothing was copied; a primary password is process-wide NSS
state, hence a file of their own. As the address suite needed,
setupStorageWithCards sets runMigrationTest false rather than clearing it, and
Bug 2071837's check that an already-measured launch never opens the store gains
a counterpart here. Three tests in creditCard/browser.toml count
creditcard.os_keystore_decrypt exactly, and the dry run decrypts every stored
card through the same trigger, so that manifest turns it off; none of them is
about the dry run.
What triggers a measurement is covered per scenario, and on the profile that
has no primary password, which is where the OS key store is the only key in
question: a card change measuring what the startup pass could not, an address
change measuring nothing, and a launch that finds a dialog already up waiting
for one that does not.
Depends on D326174
| Assignee | ||
Comment 2•2 months ago
|
||
OSKeyStore.isLoggedIn says whether a read with reauth false would retrigger a
dialog, but nothing says when it becomes true, so a caller that must not be the
one to put that dialog up can only ask again at some later point and hope.
ensureLoggedIn() now notifies OSKeyStore.UNLOCKED_TOPIC when it takes the store
from locked to unlocked: once per unlock, whatever did the unlocking, and not
for a use of a store that is already unlocked.
Updated•2 months ago
|
| Assignee | ||
Comment 3•1 month ago
|
||
#setUpAddressRustStorage, #migrateToEnabledAddressStorage and their credit card
counterparts become #maybeRunMigration(dataType), which startup and a flip of
either enabled pref call. What differs per collection -- its three prefs and its
migrator, whose config names the Rust adapter -- comes from RUST_MIGRATIONS,
keyed by AutofillDataTypes, and the prefs decide which copy runs.
Three behavior changes, the same for both collections:
- A copy into Rust wipes it first on a flip too, not only at startup, which
clears tombstones an earlier copy left there. A copy back still does not. - Every completed real copy fires the "migrate" notification, including the
startup copy into Rust, where it is redundant but harmless. - A flip that leaves Rust off runs the dry run if one is owed, where before
only startup could.
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Comment 5•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/9d3c87969337
https://hg.mozilla.org/mozilla-central/rev/110f782672da
https://hg.mozilla.org/mozilla-central/rev/a315208d502e
Updated•1 month ago
|
Description
•