(0128947)
|
hgbot
|
2021-06-02 16:03
|
|
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: c2dd367a8d387b605e3669e3796b0103caec37cd
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2021-06-01T18:46:18+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/c2dd367a8d387b605e3669e3796b0103caec37cd [^]
Fix ISSUE-46938: delete the state on sources update in a better way - pos1
Make use of the api to reset the state
It is the more secure way to delete the state, removing a property of localstorage,
after the reload, the ram is deleted so the state of the ram is lost.
Then it will try to reload the state from disk, but before do that, will check if the
localstorage property exists and if not, will delete the disk state db before try to
load it.
In this way we don't try to delete a running state and there is no race conditions that
can cause problems.
Other discarded options:
a) With indexeddb api, delete the db of the state:
const persistenceDB = new OB.App.Class.IndexedDBController('state');
persistenceDB.deleteDatabase().finally(() => {
window.location.reload();
});
- Problem: it deletes an db is use, gives an error that can not be deleted,
but in any case looks like working, but doesn't look to have the error,
also doesn't give security that will work always. Also doesn't ensure that
after delete and before the reload the db is saved again
---
M web/org.openbravo.mobile.core/source/offline/ob-fetch-manifest.js
---
|
|