Firefox is very strict about memory management in an browser extension popup.
In the cozy-keys-browser extension, we had a simple favorite method that fetch a contact and save it after adding favorite: true in the popup.
But if we :
- mark a contact as favorite
- close the popup
- open the popup
- unmark the contact as favorite
We will get an error like this cozy-client warn Could not get query from state. queryId: io.cozy.contacts/667277395369678d85fe4a93f8984909, error: can't access dead object because Firefox cleaned at least a part of the store.
Issue was bypassed in cozy/cozy-keys-browser#319 by doing the query in the background instead of the popup but I write it also here for the record.
Firefox is very strict about memory management in an browser extension popup.
In the cozy-keys-browser extension, we had a simple favorite method that fetch a contact and save it after adding
favorite: truein the popup.But if we :
We will get an error like this
cozy-client warn Could not get query from state. queryId: io.cozy.contacts/667277395369678d85fe4a93f8984909, error: can't access dead objectbecause Firefox cleaned at least a part of the store.Issue was bypassed in cozy/cozy-keys-browser#319 by doing the query in the background instead of the popup but I write it also here for the record.