Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043907Retail ModulesWeb POSpublic2020-04-30 10:322020-05-07 09:23
caristu 
migueldejuana 
highminorhave not tried
closedfixed 
5
 
RR20Q3 
marvintm
No
0043907: Error when login into WebPOS having messages pending to synchronize in the state
If we login into WebPOS an there exists messages in the state pending to be synchronized, then the following error is raised when login:

0522af920179e8c1b4896634bd7b7672.js:42453 Uncaught (in promise) TypeError: Cannot read property 'transaction' of null
    at IndexedDBController.getReadWriteTransaction (0522af920179e8c1b4896634bd7b7672.js:42453)
    at IndexedDBController.write (0522af920179e8c1b4896634bd7b7672.js:42317)
    at IndexedDBController.put (0522af920179e8c1b4896634bd7b7672.js:42309)
    at MessageModelController.put (0522af920179e8c1b4896634bd7b7672.js:44054)
    at SynchronizationBuffer.onMessagesChanged (0522af920179e8c1b4896634bd7b7672.js:44180)
    at 0522af920179e8c1b4896634bd7b7672.js:41298

This is because we are trying to save the messages into the synchronization buffer IndexedDB database before it is initialized.
0) Leave a message pending to be synchronized in the state. For example force an error in the "onMessagesChanged" before executing "OB.App.State.Messages.removeMessages"

1) Login in WebPOS, note that the error mentioned in the Description is raised in the console
Ensure that we save the pending messages once the IndexedDB database is ready
No tags attached.
depends on backport 0043909RR20Q2 closed Retail Error when login into WebPOS having messages pending to synchronize in the state 
depends on backport 0043931RR20Q2 closed migueldejuana Error when login into WebPOS having messages pending to synchronize in the state 
diff relatedTo43907.diff (1,017) 2020-04-30 10:47
https://issues.openbravo.com/file_download.php?file_id=14411&type=bug
Issue History
2020-04-30 10:32caristuNew Issue
2020-04-30 10:32caristuAssigned To => Retail
2020-04-30 10:32caristuTriggers an Emergency Pack => No
2020-04-30 10:47caristuFile Added: relatedTo43907.diff
2020-04-30 10:59caristuStatusnew => scheduled
2020-04-30 16:44caristuProposed Solution updated
2020-05-05 10:21hgbotCheckin
2020-05-05 10:21hgbotNote Added: 0119549
2020-05-05 10:21hgbotStatusscheduled => resolved
2020-05-05 10:21hgbotResolutionopen => fixed
2020-05-05 10:21hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/707f200bda830d235ae77f17e3c327552f7dede3 [^]
2020-05-05 10:23migueldejuanaAssigned ToRetail => migueldejuana
2020-05-05 10:23migueldejuanaStatusresolved => new
2020-05-05 10:23migueldejuanaResolutionfixed => open
2020-05-05 10:25migueldejuanaStatusnew => scheduled
2020-05-05 10:25migueldejuanaStatusscheduled => resolved
2020-05-05 10:25migueldejuanaResolutionopen => fixed
2020-05-05 10:25migueldejuanaFixed in Version => RR20Q3
2020-05-07 09:23marvintmReview Assigned To => marvintm
2020-05-07 09:23marvintmStatusresolved => closed

Notes
(0119549)
hgbot   
2020-05-05 10:21   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 707f200bda830d235ae77f17e3c327552f7dede3
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Tue May 05 10:21:42 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/707f200bda830d235ae77f17e3c327552f7dede3 [^]

Fixed issue 0043907: Error when login into WebPOS having messages pending to synchronize in the state

- Wait to create Messages listener until the database is created (listener do a write, so it needs to have the database created)
- In case doing a put of a message fails, do not block next executions of onMessageChanged

---
M web/org.openbravo.mobile.core/app/model/synchronization-buffer/MessageModelController.js
M web/org.openbravo.mobile.core/app/model/synchronization-buffer/SynchronizationBuffer.js
M web/org.openbravo.mobile.core/source/model/ob-terminal-model.js
---