updated_at
: update timepk
(guid) : identifier which is unique belong all devices.is_active
(is_deleted)is_conflicted
(transient, default=false)
updated_at
: the same as server sidepk
: the same as server sidesync_state
(default=SYNCD
,EDITED
,DELETED
,CREATED
) :SYNCD
just after syncing to server data. when modified data in client side, this param won't beSYNCD
state.data
(json):raw data from server.edited_data
(json, transient?):store the edited field and values which is caused in client side.is_uploading
(transient, default=false): for row level lock while syncing.
- start!
is_uploading
= truemax_updated_at
= MAX(updated_at
in items)- (if
sync_state
==SYNCED
)- get
- (if
sync_state
!=SYNCED
)- post(put, delete)
- (if get method) ->
is_conflicted
= false
- (if post method) ->
is_conflicted
=max_updated_at
<updated_at
- (if
is_conflicted
== true)- 変更を適用
- return [item ∈
max_updated_at
<updated_at
]
- (
is_conflicted
== true)- jump to 4
- (
is_conflicted
== fale)- renew
data
- renew
update_at
sync_state
=SYNCED
edited_data
= nilis_uploading
= false
- renew
- take the server side data
- jump to 3.2
- take the client side data
- renew
update_at
- jump to 1.5
- renew
- inform to user
- jump to 4.1
- jump to 4.2
- auto merge
- renew
update_at
- renew
data
bydata
from server - modified by
edited_data
- jump to 1.5
- renew