couchbaselabs / mobile-dart-flutter-plugin

1 stars 0 forks source link

Req - 3: Database.saveDocument #3

Closed Fujio-Turner closed 2 months ago

Fujio-Turner commented 10 months ago

WEB: A: Match same "thread" safe method of mutable to / from immutable like CBL. B. Write to local cache -- look at SG to see how it calculates the _rev hash and match it to prevent collision in the future. -- ttl element(timestamp) add to local cache C.HTTP PUT to remote SG host. Docs: https://docs.couchbase.com/sync-gateway/current/rest-api.html#/Document/put_keyspace_docid
-- PUT TTL/_exp

WEB TEST: if remote SG has different branch(i.e. new revision from another source) how to handle failure and/or tell user.

MOBILE: https://docs.couchbase.com/couchbase-lite/current/c/document.html#save-a-document

Fujio-Turner commented 10 months ago

WEB: looking an SG code of making _rev hash. looks like it uses. CRC32c(JSON_BODY_HERE) algorithm. Could someone double check. source: https://github.com/couchbase/sync_gateway/blob/master/db/document.go