Openbravo Issue Tracking System - Retail Modules
View Issue Details
0040432Retail ModulesStoreServerpublic2019-03-21 16:032019-03-22 09:38
AugustoMauch 
AugustoMauch 
normalminorhave not tried
newopen 
5
 
 
No
0040432: OBMOBC_SERVER_DEFINITION.delta_age means two different things, it can be improved
The delta_age column of the OBMOBC_SERVER_DEFINITION table will be null for a given store server if:
1- The store server has not received any ping yet from the central server, or
2- It received a ping, but there were no batches pending to be sent from that store server.

This double meaning makes difficult to decide if the delta age is expired when it is null. In case #1 it makes sense to assume it is expired, while in case #2 it is not expired.

It would be better if the central server includes as max_age the current time when there are no batches pending to be sent to the store server, instead of including null.
-
No tags attached.
Issue History
2019-03-21 16:03AugustoMauchNew Issue
2019-03-21 16:03AugustoMauchAssigned To => AugustoMauch
2019-03-21 16:03AugustoMauchTriggers an Emergency Pack => No
2019-03-22 09:38mtaalNote Added: 0110568

Notes
(0110568)
mtaal   
2019-03-22 09:38   
I don't agree that it has a double meaning.. There is another field in the same table: lastping. This already covers the first mentioned meaning. If this field is null then no ping has yet been received.

But the other message of this issue (do not go offline when no ping yet received) makes for sure sense. Using the existing lastping field this means:
- do not allow going offline when lastping==null

Then also another change is needed. As the current delta age is too pessimistic. For example the following flow would not be allowed to go offline:
- cs/internet goes down at 8 am, lastping is from 8 am and at that time there was data to sync which was 1 second old
- the stores start working around 10 am but as cs is not there it wants to offline
- but offline is not possible as the delta age is 7:59:59 am. In this case the store could have started working as the store was only 1 second behind at the time the internet went down. That's perfectly fine.

So instead of comparing delta-age with the current datetime [1], compare it with lastping. Meaning that delta age signals how much the ss was behind in syncing batches at the time the last ping was received.
Cause this is really what it should check.

Another change which is probably better to not make the system too negative, also to only check the store data channel [2].

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/src/org/openbravo/mobile/core/servercontroller/MobileServerUtils.java#l110 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java#l541 [^]