Open Bug 1521421 Opened 4 years ago Updated 1 year ago

Uninstalling an extension that is also present in another install location should act as upgrade/downgrade

Categories

(Toolkit :: Add-ons Manager, defect, P3)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: yfdyh000, Unassigned)

References

Details

(Keywords: dataloss)

If there is already a duplicate bugs, mark it, this issue seems to have a long history.

STR:

  1. Install an add-on from http://addons.mozilla.org/.
  2. Make some changes to the storage of the add-on.
  3. Load its xpi or source code from local via about:debugging#addons for debugging.
  4. When you're done debugging or need to go back to the original, choose to 'Remove' the add-on via about:debugging#addons.

Actual results:
After you complete step four, you see the original add-on version, but its storage has been accidentally emptied and there is no way to retrieve it.
If you choose to close or restart the browser, the add-on storage is preserved and the temporarily loaded add-on is dumped.

Expected results:
Restore the previous storage (if any) when removing a temporarily loaded add-on. Although debugging with a daily profile is undesirable, it can happen and unexpected data loss should not be. Or at least, provide a data removal warning if it is an overlay loaded add-on.

The problem is basically here:
https://searchfox.org/mozilla-central/rev/9eb30227b21e0aa40d51d9f9b08bb0b113c5fadb/toolkit/mozapps/extensions/internal/XPIInstall.jsm#3852-3864

When uninstalling an extension from one location reveals the same extension in a different location, we handle this as an uninstall followed by an install. This is inconsistent with the install logic (which is unfortunately duplicated in a few places) which treats installing an existing extension in a new location as an upgrade (or downgrade). I think the best course here is to change the uninstall process to treat this scenario as an upgrade/downgrade.

Component: Developer Tools → Add-ons Manager
Product: WebExtensions → Toolkit
Summary: Removing an overlay loaded add-on should return its storage instead of deleting it → Uninstalling an extension that is also present in another install location should act as upgrade/downgrade
Priority: -- → P2
Severity: normal → S3
Priority: P2 → P3
See Also: → 1617248
You need to log in before you can comment on or make changes to this bug.