Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043721Retail ModulesWeb POSpublic2020-04-13 14:152020-04-22 07:10
caristu 
caristu 
highminorN/A
closedfixed 
5
 
RR20Q3 
alostale
No
0043721: Change IndexedDBController and MasterdataController API to define async functions instead of returning Promises
The functions of IndexedDBController and MasterdataController that are returning Promises can be changed to define them as async functions. See [1] and [2].

In the case of IndexedDBController functions we can follow this pattern[3].

This change should be transparent for the API consumers.

[1] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/web/org.openbravo.mobile.core/app/model/persistence/indexeddb/IndexedDBController.js#L206 [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/web/org.openbravo.mobile.core/app/model/masterdata/MasterdataController.js#L482 [^]
[3] https://stackoverflow.com/questions/46933801/how-do-i-wrap-a-callback-with-async-await/46933884#46933884 [^]
.
Replace Promise returning with async function definition
No tags attached.
Issue History
2020-04-13 14:15caristuNew Issue
2020-04-13 14:15caristuAssigned To => Retail
2020-04-13 14:15caristuTriggers an Emergency Pack => No
2020-04-13 14:15caristuSummaryChange IndexedDBController and MasterdataController API to define asyn functions instead of returning Promises => Change IndexedDBController and MasterdataController API to define async functions instead of returning Promises
2020-04-16 08:08alostaleAssigned ToRetail => caristu
2020-04-16 08:09alostaleReview Assigned To => alostale
2020-04-17 09:43hgbotCheckin
2020-04-17 09:43hgbotNote Added: 0119229
2020-04-17 09:43hgbotStatusnew => resolved
2020-04-17 09:43hgbotResolutionopen => fixed
2020-04-17 09:43hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f3bf0b0001dbfda3e7549de5b71821dd8258b26f [^]
2020-04-17 10:08hgbotCheckin
2020-04-17 10:08hgbotNote Added: 0119230
2020-04-22 07:10alostaleStatusresolved => closed
2020-04-22 07:10alostaleFixed in Version => RR20Q3

Notes
(0119229)
hgbot   
2020-04-17 09:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: f3bf0b0001dbfda3e7549de5b71821dd8258b26f
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Apr 15 17:31:25 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f3bf0b0001dbfda3e7549de5b71821dd8258b26f [^]

fixes BUG-43721: define async functions

  Define async functions in both the IndexedDB and Masterdata APIs
instead of returning Promises.

  Together with those changes we are also removing a useless third
parameter when invoking IndexedDBController.put in two places of the
MasterdataController. Currently this function accepts just two arguments.

---
M web/org.openbravo.mobile.core/app/model/masterdata/MasterdataController.js
M web/org.openbravo.mobile.core/app/model/masterdata/MasterdataModel.js
M web/org.openbravo.mobile.core/app/model/persistence/indexeddb/IndexedDBController.js
M web/org.openbravo.mobile.core/app/model/persistence/indexeddb/IndexedDBQuery.js
M web/org.openbravo.mobile.core/app/model/persistence/indexeddb/Model.js
M web/org.openbravo.mobile.core/app/model/synchronization-buffer/MessageModelController.js
M web/org.openbravo.mobile.core/app/model/synchronization-buffer/SynchronizationBuffer.js
---
(0119230)
hgbot   
2020-04-17 10:08   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 706c2f637dc33879677e130564f7f59e12f12d73
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Apr 17 10:07:32 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/706c2f637dc33879677e130564f7f59e12f12d73 [^]

related to BUG-43721: define async functions in web-test

---
M web-test/model/persistence/indexeddb/IndexedDBController.test.js
M web-test/model/persistence/indexeddb/models.js
---