Bug 1960313: Stop throwing unneeded notification for stale credit card entry notifications r=dimi

Differential Revision: https://phabricator.services.mozilla.com/D250037
This commit is contained in:
Simon Friedberger
2025-05-19 18:59:46 +00:00
committed by sfriedberger@mozilla.com
parent 27594c2ac5
commit 0f1118935f
3 changed files with 3 additions and 11 deletions

View File

@@ -366,11 +366,6 @@ add_task(async function test_notifyUsed() {
getSyncChangeCounter(profileStorage.addresses, guid),
changeCounter
);
Assert.throws(
() => profileStorage.addresses.notifyUsed("INVALID_GUID"),
/No matching record\./
);
});
add_task(async function test_remove() {

View File

@@ -469,11 +469,6 @@ add_task(async function test_notifyUsed() {
Assert.equal(creditCard.timesUsed, timesUsed + 1);
Assert.notEqual(creditCard.timeLastUsed, timeLastUsed);
Assert.throws(
() => profileStorage.creditCards.notifyUsed("INVALID_GUID"),
/No matching record\./
);
});
add_task(async function test_remove() {

View File

@@ -539,7 +539,9 @@ class AutofillRecords {
let recordFound = this._findByGUID(guid);
if (!recordFound) {
throw new Error("No matching record.");
// record must have been deleted, nothing to update
this.log.debug("Cannot notify. No record found with guid:", guid);
return;
}
recordFound.timesUsed++;