So [`ServiceWorkerManager::RemoveScopeAndRegistration`](https://searchfox.org/mozilla-central/rev/fb8d77331582639ea6848a61dd8ee812fac31b77/dom/serviceworkers/ServiceWorkerManager.cpp#1790,1795) does first remove the `data->mInfos.Remove(aRegistration->Scope(), getter_AddRefs(info));` and then calls `swm->MaybeRemoveRegistrationInfo(scopeKey);`. But [`swm->MaybeRemoveRegistrationInfo(scopeKey);`](https://searchfox.org/mozilla-central/rev/fb8d77331582639ea6848a61dd8ee812fac31b77/dom/serviceworkers/ServiceWorkerManager.cpp#1798) removes the entry only under certain conditions. [`ServiceWorkerManager::CheckPrincipalQuotaUsage`](https://searchfox.org/mozilla-central/rev/fb8d77331582639ea6848a61dd8ee812fac31b77/dom/serviceworkers/ServiceWorkerManager.cpp#2293-2295,2310) seems to assume that if the `RegistrationDataPerPrincipal` exists we will also find an entry for `ServiceWorkerRegistrationInfo`. It is not clear to me if this is a strong assumption we should enforce or if we can simply return instead of asserting.
Bug 1740551 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
So [`ServiceWorkerManager::RemoveScopeAndRegistration`](https://searchfox.org/mozilla-central/rev/fb8d77331582639ea6848a61dd8ee812fac31b77/dom/serviceworkers/ServiceWorkerManager.cpp#1790,1795) does first remove the `data->mInfos.Remove(aRegistration->Scope(), getter_AddRefs(info));` and then calls `swm->MaybeRemoveRegistrationInfo(scopeKey);`. But [`swm->MaybeRemoveRegistrationInfo(scopeKey);`](https://searchfox.org/mozilla-central/rev/fb8d77331582639ea6848a61dd8ee812fac31b77/dom/serviceworkers/ServiceWorkerManager.cpp#1798) removes the entry only under certain conditions. [`ServiceWorkerManager::CheckPrincipalQuotaUsage`](https://searchfox.org/mozilla-central/rev/fb8d77331582639ea6848a61dd8ee812fac31b77/dom/serviceworkers/ServiceWorkerManager.cpp#2293-2295,2310) instead seems to assume that if the `RegistrationDataPerPrincipal` exists we will also find an entry for `ServiceWorkerRegistrationInfo`. It is not clear to me if this is a strong assumption we should enforce or if we can simply return instead of asserting.