kinto.js icon indicating copy to clipboard operation
kinto.js copied to clipboard

Sync status should be indexed by remote

Open glasserc opened this issue 8 years ago • 5 comments

Right now, syncing to two different remotes is impossible, because the sync status is global for all remotes. It would be good for sync status to be specific to a given remote, so that when you switch remotes, the old state doesn't confuse the sync to the new remote.

glasserc avatar Jan 25 '17 16:01 glasserc

Maybe it would also make sense to scope by «user» (?). The same happens with you sync with two different users.

leplatrem avatar Mar 29 '17 11:03 leplatrem

One challenge is how to scope by user in cases like FxA authentication, when the client might not actually know who the user actually is (it just has a Bearer token which the server uses to lookup a user IIUC).

glasserc avatar Apr 03 '17 14:04 glasserc

You should use the remote user_id to achieve that. Then the scope should be the (remote_URL, user_id)

Natim avatar Apr 03 '17 15:04 Natim

Using the remote user ID means having to ask the user "who am I?" at the beginning of every sync.

glasserc avatar Apr 04 '17 21:04 glasserc

Using the remote user ID means having to ask the user "who am I?" at the beginning of every sync.

It can also be done only the first time and kept on the client side as a value using the Authorization header as a key. Then it will happens only if the first time you use a Bearer token.

Natim avatar Apr 05 '17 17:04 Natim