Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary Container ID's persistent and accumulating in storage.js #198

Closed
SoloRaven opened this issue Dec 30, 2018 · 6 comments
Closed

Comments

@SoloRaven
Copy link

Good day,

I take note of related Issue #145 reported on May 19 and subsequently closed and report the matter as disclosed below once more as it does not seem to be resolved.

  • Temporary Containers Version: 0.90 (latest)
  • Firefox Version: 64.0 (64-bit latest)
  • Operating System + Version: Windows 10 Pro 1809 (Build 17763.1)
  • Non-default Options/Preferences in Temporary Containers:
    . Set all mouse click settings on the GLOBAL tab to open new temp containers
    if the new destination domain does not EXACTLY match the current tab's domain.
    . Set containers to be deleted at once when the last tab in it is closed.
  • Other installed Add-ons + Version:
    . Firefox Multi-Account Containers ver 6.0.1 (latest)

### Actual behavior

  • A list of permanent containers seems to be stored in the profile root folder in a file called: "containers.json" and appears to be working fine (i.e. permanent containers are listed in there and temp containers are appended when created in Firefox and removed when the relevant tabs are deleted).
  • Another file exists inside the “profile\browser-extensions-data@testpilot-containers\” folder called “storage.js” and appears to be storing the container rules (e.g. A rule for youtube.com to always open in the Youtube container etc.)
  • It further appears that either the “Temporary Container” or “Firefox Multi-Account Containers” plugin or perhaps both even, commit changes to this storage.js file.
  • The problem I came across is that inside this storage.js file an ever-growing list of entries (rules/ID's) are accumulating for all the temporary containers ever created and removed.
  • Further, it can be learned from the attached storage.js file that the container ID's are ever increasing although this does NOT affect the container ID's displayed on the Firefox address bar, which was set to be recycled and seems to be working fine.
  • In my current storage.js file the temp container storage rules have accumulated to over 2300 entries already!
  • A small sample of the entries:
	........},
	"identitiesState@@_firefox-container-2335": {
		"hiddenTabs": []
	},
	"identitiesState@@_firefox-container-2336": {
		"hiddenTabs": []
	},
	"identitiesState@@_firefox-container-2337": {
		"hiddenTabs": []
	},
	"identitiesState@@_firefox-container-2338": {
		"hiddenTabs": []
	},
	"identitiesState@@_firefox-container-2339": {
		"hiddenTabs": []
	}.........

### Expected behavior

  • I would argue that it would be expected that once a temporary container is closed and removed, that its relevant container rule is also removed from the storage.js file.
  • If this does not happen, this file will simply grow indefinitely which I suppose is not favorable.

### Steps to reproduce

  1. Open any site, which is not linked to a permanent container, that opens in a new temporary container.
  2. Inspect the storage.js file and notice a new entry for the temp container appended at the bottom of the file.
  3. Close the tabs, consequently deleting the container and inspect the storage.js file again and find that the previously created container’s rule is still present.
  4. Create more temp containers as described in Nr. 1 and repeat Nr. 2- 3 and find that the entries just grow and grow.

## DEBUG LOG attached for Bonus Points :-)
debug_log.txt

I supposed digging into the storage.js file on a regular basis to clear out the mess is possible but not favorable and there appears to be no good reason for the persistence.

Please accept my sincerest gratitude for creating and sharing this great addition to the struggle for online privacy.

Kind regards,
SoloRaven

@stoically
Copy link
Owner

As mentioned in #145 this depends on mozilla/multi-account-containers#1140 to get merged, nothing that can be done in TC. You could add a thumbs up there.

@Arthaey
Copy link
Contributor

Arthaey commented Jul 8, 2019

Is there a manual way users could clean this up periodically, until Mozilla fixes the underlying bug?

@stoically
Copy link
Owner

stoically commented Jul 8, 2019

FWIW, here's a snippet you could execute on MACs about:debugging console:

browser.contextualIdentities.query({}).then(containers => {
    const containerIds = Object.values(containers).map(
        container => parseInt(container.cookieStoreId.match(/-(\d+)$/)[1])
    );
    const everyContainerId = Array.apply(null, {length: Math.max(...containerIds)+1}).map(
        Number.call, Number
    );
    const removeContainerIds = everyContainerId.filter(
        eId => eId > 0 && !containerIds.find(cId => cId === eId)
    );
    browser.storage.local.remove(removeContainerIds.map(
        rcId => `identitiesState@@_firefox-container-${rcId}`)
    );
})

You could wrap that into a setInterval(() => snippet, timeInMs);, though that would only run until the browser shuts down.

@sh4r1k7
Copy link

sh4r1k7 commented Apr 16, 2020

@stoically I tried that script but it didn't remove anything. no errors either. I verified that the identities query returns 1000+ containers every time. I'm not familiar enough with the storage to take this further on my own - any clues?

@stoically
Copy link
Owner

stoically commented Apr 16, 2020

@3dc1d3 If the query returns the containers, there's nothing to remove in MACs storage.js, since the containers still exist. Your issue likely is #371

@sh4r1k7
Copy link

sh4r1k7 commented Apr 18, 2020

thanks @stoically, that's indeed my issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants