SyncUpTarget
Target for sync up:
what records to upload to server
how to upload those records
During a sync up, sync manager does the following:
it calls getIdsOfRecordsToSyncUp to get the ids of records to sync up
for each id it does:
a) if calls getFromLocalStore to get the record itself
b) if merge mode is leave-if-changed, it calls isNewerThanServer, if that returns false, it goes to the next id
c) otherwise it does one of the following three operations:
calls deleteOnServer if isLocallyDeleted returns true for the record (unless it is also locally created, in which case it gets deleted locally right away) if successful or not found is returned, it calls deleteFromLocalStore to delete record locally
calls createOnServer if isLocallyCreated returns true for the record if successful, it updates the id to be the id returned by the server and then calls cleanAndSaveInSmartstore to reset local flags and save the record locally
calls updateOnServer if isLocallyUpdated returns true for the record if successful, it calls cleanAndSaveInSmartstore to reset local flags and save the record if not found and merge mode is overwrite, it calls createOnServer to recreate the record on the server
Inheritors
Constructors
Properties
Functions
Same as isNewerThanServer but operating over a list of records (expected to be of the same sobject type) Return map from record store id to boolean
Save cleaned record in local store
Save locally created record back to server
Delete record from local store
Delete locally deleted record from server
Return ids of "dirty" records (records locally created/upated or deleted)
Get record from local store by storeId
Get records from local store by storeId
Return ids of records to sync up
Given a record, return true if it was locally created/updated or deleted
Given a record, return true if it was locally created
Given a record, return true if it was locally deleted
Given a record, return true if it was locally updated
Return true if record is more recent than corresponding record on server NB: also return true if both were deleted or if local mod date is missing
Save records to local store
Save record with last error if any
Save locally updated record back to server