Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0046831
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[POS2] Coremajorhave not tried2021-05-25 15:592021-06-02 12:43
ReporteralostaleView Statuspublic 
Assigned Togorka_gil 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0046831: error when updating sources

DescriptionWhen sources are updated state database is deleted, this step throws an error that can be seen in console.
Steps To ReproduceServing in production mode

1. Login pos2
2. Update sources and deploy the production bundle
3. Reload pos2
  -> ERROR: check console

POS2.js:3247 Error: Cannot drop database POS2_state because request is blocked
    at IDBOpenDBRequest.<anonymous> (http://localhost:8181/openbravo/web/pos/static/js/12.3c2e1da5.chunk.js:1:101307 [^]); line: Ee (0.92304dcb.chunk.js:1) (*)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0046498 closedalostale POS2 New sources are not updated till doing a reload (F5) in the pos 
depends on backport 0046895TAP closedgorka_gil POS2 error when updating sources 
related to defect 0046938 closedgorka_gil Retail Modules error when updating sources - pos1 

-  Notes
(0128825)
hgbot (developer)
2021-05-31 19:57

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/528 [^]
(0128857)
hgbot (developer)
2021-06-01 13:25

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 6a29db215e1e5701bf84c7239c36593816b12dd6
Author: Gorka Gil <gorka.gil@openbravo.com>
Date: 2021-06-01T12:16:15+02:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/6a29db215e1e5701bf84c7239c36593816b12dd6 [^]

Fix ISSUE-46831: delete the state on sources update in a better way

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

b) Purge db with localforage api:
  OB.App.State.getPersistence().stateStorePersistor.purge()
  It can be used since a recent change that ensures that state is started
  before the check of sources.
  - Problem: It works on F5, but not in logut/login not clear why.

c) New state action that clear the state:
  Tested but looks like is not working, not clear why but the state is not reset
  maybe some protection in the code.
  In any case will probably launch the listeners of the state, and since all the
  spected variables are not there very probably will produce errors.

---
M web-jspack/org.openbravo.core2/src/registerServiceWorker.js
---
(0128858)
hgbot (developer)
2021-06-01 13:25

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/528 [^]

- Issue History
Date Modified Username Field Change
2021-05-25 15:59 alostale New Issue
2021-05-25 15:59 alostale Assigned To => Retail
2021-05-25 15:59 alostale Triggers an Emergency Pack => No
2021-05-25 16:00 alostale Relationship added related to 0046498
2021-05-25 16:01 alostale Resolution time => 1623708000
2021-05-26 07:10 alostale Assigned To Retail => platform
2021-05-26 07:10 alostale Status new => acknowledged
2021-05-28 13:17 alostale Assigned To platform => gorka_gil
2021-05-28 13:17 alostale Issue Monitored: alostale
2021-05-28 22:19 guilleaer Status acknowledged => scheduled
2021-05-31 19:57 hgbot Note Added: 0128825
2021-06-01 13:25 hgbot Note Added: 0128857
2021-06-01 13:25 hgbot Note Added: 0128858
2021-06-01 18:44 gorka_gil Relationship added related to 0046938
2021-06-02 12:43 alostale Status scheduled => resolved
2021-06-02 12:43 alostale Resolution open => fixed
2021-06-02 12:43 alostale Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker