I want to determine if the following offline synchronization behaviour is by design or a result of some improper LCDS config or client code.
Scenario: After committing a change to the offline cache, I see the "commitRequire" flag on the DataStore is set as true and I save the offline cache. Next, I close the app, start up my server and restart the app expect the offline data to by synchronized. On application restart one thing I noticed is that on initialization of the DataService and DataStore, the "commitRequire" is false even though the offline DataStore was previously required a commit. If I do a fill for data that was modified in offline mode, my success callback registered to the AsyncToken from the fill call is called twice. It seems one result of the fill is coming from the offline data cache and the other is from the server side data. After the fill call, the "commitRequire" flag of the DataStore is now set to be true and that is were I do a commit. Q. Is this expected? Does LCDS compare the fill results between the offline cache and the server data to determine if "commitRequire" is true? Should I blindly call commit once I leave offline mode and delete the offline cache? If I delete the offline cache from the filesystem, the callback from the fill is only called once. Ideally I want the callback from the fill to only be called once and to contain the synchronized results of the fill. Q. In looking at the LCDS dev guide is see the follow passage in Chapter 18: Advanced data handling: "If there is a connection available after the local cache is loaded, the current reconnectPolicy property value is consulted to determine how a request for the current data will be made. If the reconnectPolicy property is set to IDENTITY, no request for remote data is made because it is assumed that the data is up-to-date. If the reconnectPolicy property is set to INSTANCE, a request for the remote data is made and the result of that fill is used to overwrite the current in-memory version." Where is the "reconnectPolicy" defined and do I need to change this? I apologize for the length of the post, I've tried to be as concise as possible.