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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035601
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServerminorhave not tried2017-03-22 16:402017-03-31 12:30
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in VersionRR17Q2
StatusclosedFix in branchFixed in SCM revision012e6b7ab09c
ProjectionnoneETAnoneTarget VersionRR17Q2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToAugustoMauch
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035601: Transition to offline is not triggered at every location in the MultiServerJSONProcess code

DescriptionThere are different ways in which an exception from the call to central is handled in the multi-server-json-process code. In one place a transition to offline is done [1], while in the other [2] this is not done.

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/553553b86771/src/org/openbravo/mobile/core/servercontroller/MultiServerJSONProcess.java#l390 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/553553b86771/src/org/openbravo/mobile/core/servercontroller/MultiServerJSONProcess.java#l361 [^]
Steps To ReproduceSee the code links
Proposed SolutionIn both locations in the code the same behavior should be done: transition to offline.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0035667RR17Q3 closedmtaal Move duplicate code together in one method in MultiServerJSONProcess 

-  Notes
(0095647)
mtaal (manager)
2017-03-29 14:25

Tested this by forcing the code in MultiServerJSONProcess to go into the first if and then throwing an exception:

    if (true || executeOnlyInCentral(jsonSent)) {
      final JSONObject jsonToCentral = new JSONObject(jsonSent.toString());
      // sent along from the store to central, set the source to STORE
      jsonToCentral.put(SOURCE_PROP, SOURCE_STORE);
      // prevent cycling around
      jsonToCentral.remove(CALL_ONLY_CENTRAL_PROP);
      JSONObject centralResult = null;
      try {
        centralResult = MobileServerRequestExecutor.getInstance().executeCentralRequest(
            MobileServerUtils.OBWSPATH + this.getClass().getName(), jsonToCentral);
        if (true) {
          throw new Exception("TEST");
        }
      } catch (Throwable t) {
        log.error(t.getMessage(), t);
(0095648)
hgbot (developer)
2017-03-29 14:27

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 012e6b7ab09cfdfc418a351f098d40560a1ac59f
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Mar 29 14:26:56 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/012e6b7ab09cfdfc418a351f098d40560a1ac59f [^]

Fixes issue 35601: Transition to offline is not triggered at every location in the MultiServerJSONProcess code
In case of only central request then use the same transition to offline code and returning error as in other places in this class.

---
M src/org/openbravo/mobile/core/servercontroller/MultiServerJSONProcess.java
---
(0095708)
AugustoMauch (manager)
2017-03-30 13:29
edited on: 2017-03-30 16:45

The code that handlers the flow when there is an exception here [1] and here [2] is duplicated. It would be better if this code is extracted to a function.

Also, this line [3] states that the transition to offline will only be done if the node is not transitioning. But the transition to offline should be done if the node is transitioning to online, right?

[1] https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/012e6b7ab09c/src/org/openbravo/mobile/core/servercontroller/MultiServerJSONProcess.java#l361 [^]
[2] https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/012e6b7ab09c/src/org/openbravo/mobile/core/servercontroller/MultiServerJSONProcess.java#l418 [^]
[3] https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/012e6b7ab09c/src/org/openbravo/mobile/core/servercontroller/MultiServerJSONProcess.java#l432 [^]

(0095760)
mtaal (manager)
2017-03-31 12:27

As only code needs to copied in a separate method the choice is made to do this in a new issue in the Q3 release.
(0095762)
mtaal (manager)
2017-03-31 12:28

Remaining changes will be done in related issue
(0095763)
AugustoMauch (manager)
2017-03-31 12:30

Code reviewed and verified

- Issue History
Date Modified Username Field Change
2017-03-22 16:40 mtaal New Issue
2017-03-22 16:40 mtaal Assigned To => mtaal
2017-03-22 16:40 mtaal Triggers an Emergency Pack => No
2017-03-29 14:25 mtaal Note Added: 0095647
2017-03-29 14:27 hgbot Checkin
2017-03-29 14:27 hgbot Note Added: 0095648
2017-03-29 14:27 hgbot Status new => resolved
2017-03-29 14:27 hgbot Resolution open => fixed
2017-03-29 14:27 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/012e6b7ab09cfdfc418a351f098d40560a1ac59f [^]
2017-03-29 14:29 mtaal Review Assigned To => AugustoMauch
2017-03-30 13:29 AugustoMauch Note Added: 0095708
2017-03-30 13:30 AugustoMauch Status resolved => new
2017-03-30 13:30 AugustoMauch Resolution fixed => open
2017-03-30 13:30 AugustoMauch Note Edited: 0095708 View Revisions
2017-03-30 13:30 AugustoMauch Note Edited: 0095708 View Revisions
2017-03-30 16:45 AugustoMauch Note Edited: 0095708 View Revisions
2017-03-31 12:27 mtaal Note Added: 0095760
2017-03-31 12:28 mtaal Status new => scheduled
2017-03-31 12:28 mtaal Note Added: 0095762
2017-03-31 12:28 mtaal Status scheduled => resolved
2017-03-31 12:28 mtaal Fixed in Version => RR17Q2
2017-03-31 12:28 mtaal Resolution open => fixed
2017-03-31 12:29 mtaal Relationship added related to 0035667
2017-03-31 12:30 AugustoMauch Note Added: 0095763
2017-03-31 12:30 AugustoMauch Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker