Openbravo Issue Tracking System - Retail Modules
View Issue Details
0046489Retail ModulesWeb POSpublic2021-05-04 10:442021-05-05 08:01
caristu 
ranjith_qualiantech_com 
immediatecriticalhave not tried
closedfixed 
5
 
RR21Q2RR21Q2 
No
0046489: action preparation order is modified when the action fails
When an action fails, the action preparation rollback mechanism is executed[1].

This mechanism executes all the rollback functions of each action preparation in reverse order.

In order to retrieve the reversed order of rollback functions we are using the reverse function[2]. Note that reverse function mutates the original array[3].

In practice, this means that if an action fails, the next time it is executed the action preparations are executed in reversed order.

[1] http://wiki.openbravo.com/wiki/StateController#Action_Preparations [^]
[2] https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/blob/master/web/org.openbravo.mobile.core/app/model/application-state/State.js#L60 [^]
[3] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse [^]
1) Put mobile.core in this branch:
2) Execute the State.test.js which contains a reproducer for the situation described in Description
3) Note that the test fails
No tags attached.
blocks defect 0046479 closed caristu action preparation order is modified when the action fails 
Issue History
2021-05-04 17:06marvintmTypedefect => backport
2021-05-04 17:06marvintmTarget Version => RR21Q2
2021-05-04 18:36ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2021-05-05 07:42hgbotNote Added: 0127794
2021-05-05 08:01hgbotResolutionopen => fixed
2021-05-05 08:01hgbotStatusscheduled => closed
2021-05-05 08:01hgbotNote Added: 0127803
2021-05-05 08:01hgbotFixed in Version => RR21Q2
2021-05-05 08:01hgbotNote Added: 0127804

Notes
(0127794)
hgbot   
2021-05-05 07:42   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/220 [^]
(0127803)
hgbot   
2021-05-05 08:01   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/220 [^]
(0127804)
hgbot   
2021-05-05 08:01   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core [^]
Changeset: 9e58c3cb4cd8a5e40e152a936311566b0972a0dd
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 2021-05-04T22:27:10+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/commit/9e58c3cb4cd8a5e40e152a936311566b0972a0dd [^]

Fixed ISSUE-46489: Action preparation order is modified when the action fails

---
M web-test/model/application-state/State.test.js
M web/org.openbravo.mobile.core/app/model/application-state/State.js
---