Openbravo Issue Tracking System - Retail Modules
View Issue Details
0043732Retail ModulesWeb POSpublic2020-04-14 15:232020-04-30 13:12
alostale 
alostale 
normalmajorhave not tried
closedfixed 
5
 
RR20Q3 
jarmendariz
No
0043732: state listener that changes another state gets incorrectly invoked
If a state model listener for model A produces a new state in another model, that listener gets incorrectly invoked again producing a cycle.
See test: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/14/diffs?commit_id=f7688ac26b68fb501b4a444bdb9c2c9744a487ea [^]
No tags attached.
Issue History
2020-04-14 15:23alostaleNew Issue
2020-04-14 15:23alostaleAssigned To => Retail
2020-04-14 15:23alostaleTriggers an Emergency Pack => No
2020-04-15 09:18alostaleSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=20769#r20769
2020-04-15 15:35alostaleAssigned ToRetail => alostale
2020-04-15 15:35alostaleReview Assigned To => jarmendariz
2020-04-16 08:35alostaleNote Added: 0119208
2020-04-16 08:38hgbotCheckin
2020-04-16 08:38hgbotNote Added: 0119209
2020-04-16 08:38hgbotStatusnew => resolved
2020-04-16 08:38hgbotResolutionopen => fixed
2020-04-16 08:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0c560720a3701c00c66994b68f7bac0dc9e1f7b3 [^]
2020-04-30 13:12jarmendarizNote Added: 0119503
2020-04-30 13:12jarmendarizStatusresolved => closed
2020-04-30 13:12jarmendarizFixed in Version => RR20Q3

Notes
(0119208)
alostale   
2020-04-16 08:35   
MR: https://gitlab.com/openbravo/product/pmods/org.openbravo.mobile.core/-/merge_requests/14 [^]
(0119209)
hgbot   
2020-04-16 08:38   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 0c560720a3701c00c66994b68f7bac0dc9e1f7b3
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Tue Apr 14 15:30:36 2020 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/0c560720a3701c00c66994b68f7bac0dc9e1f7b3 [^]

fixed BUG-43732: listeners changing state are incorrectly invoked

When a state model listener produced a new state in another model, it
was invoked again.

This was caused because current state that is kept within
ListenerManager to compare with current state was refreshed only after
all listeners were executed, if a listener produced a new state, the
base comparision should be the state just before invoking it rather than
the original one.

Now current state gets updated before listener execution so in case it
produces changes, states comparision is correct.

---
M web-test/model/application-state/PersistenceChangeListenerManager.test.js
M web/org.openbravo.mobile.core/app/model/application-state/PersistenceChangeListenerManager.js
---
(0119503)
jarmendariz   
2020-04-30 13:12   
Reviewed