commit df82004c2563d03ebfbc16d4893c6154cdab2be4
parent 989e81b61c6d290bb162c666c1b0ccb3c5acd7ef
Author: Neil Deakin <neil@mozilla.com>
Date: Tue, 16 Dec 2025 14:45:46 +0000
Bug 2005630, add housenumber to VALID_ADDRESS_COMPUTED_FIELDS, r=credential-management-reviewers,dimi
Differential Revision: https://phabricator.services.mozilla.com/D276089
Diffstat:
2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/browser/extensions/formautofill/test/unit/test_sync.js b/browser/extensions/formautofill/test/unit/test_sync.js
@@ -650,6 +650,52 @@ add_task(async function test_incoming_dupes() {
}
});
+add_task(async function test_dedupe_identical_unsynced_singlelineaddress() {
+ let { profileStorage, server, engine } = await setup();
+ try {
+ let profile = structuredClone(TEST_PROFILE_1);
+ // Change the street address so that it will parse correctly.
+ profile["street-address"] = "36 Main Street";
+
+ // create a record locally.
+ let localGuid = await profileStorage.addresses.add(profile);
+
+ // and an identical record on the server but different GUID.
+ let remoteGuid = Utils.makeGUID();
+ notEqual(localGuid, remoteGuid);
+ server.insertWBO(
+ "foo",
+ "addresses",
+ new ServerWBO(
+ remoteGuid,
+ encryptPayload({
+ id: remoteGuid,
+ entry: Object.assign(
+ {
+ version: 1,
+ },
+ profile
+ ),
+ }),
+ getDateForSync()
+ )
+ );
+
+ await engine.setLastSync(0);
+ await engine.sync();
+
+ // Should have 1 item locally with GUID changed to the remote one.
+ // There's no tombstone as the original was unsynced.
+ await expectLocalProfiles(profileStorage, [
+ {
+ guid: remoteGuid,
+ },
+ ]);
+ } finally {
+ await cleanup(server);
+ }
+});
+
add_task(async function test_dedupe_identical_unsynced() {
let { profileStorage, server, engine } = await setup();
try {
diff --git a/toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs b/toolkit/components/formautofill/FormAutofillStorageBase.sys.mjs
@@ -184,6 +184,7 @@ const VALID_ADDRESS_COMPUTED_FIELDS = [
...AddressRecord.NAME_COMPONENTS,
...AddressRecord.STREET_ADDRESS_COMPONENTS,
...AddressRecord.TEL_COMPONENTS,
+ "address-housenumber",
];
export const VALID_CREDIT_CARD_FIELDS = [