Closed AlexeyBarabash closed 4 years ago
Here comes with the summary of discussion with @bridiver on slack,
/useridprefix/devices/deviceid -> uuid
mapping, so each device will try to write the map along with a long period recheck to achieve eventually consistent.SAVE_INIT_DATA
with an empty seed and new id, client will save new id and send new CREATE device record with new id.
It is possible situation when two different devices in the chain have the same id. Which is wrong.
Steps to reproduce with brave-core:
Prepare 3 clear profiles: deviceA, deviceB, deviceC
on deviceB and deviceC open brave://sync and click
I have sync code
, but don't enter any code for nowon deviceA enable sync chain and copy sync code
paste sync code on both deviceB and deviceC, but don't press
Confirm sync code
buttonarrange deviceB and deviceC windows to see both
Confirm sync code
buttonspress
Confirm sync code
buttons as fast as possible on both deviceB and deviceCActual result: deviceB and deviceC have two entries marked as
This device
, this means devices have the same deviceId equal to current device id.Expected result: deviceB and deviceC are properly marked as
This device
just one in the list.This is an issue for sync library, if two devices almost in the same time are doing connect to the sync chain, they can get response with the same id: https://github.com/brave/sync/blob/staging/client/sync.js#L71
Log from deviceC:
Log from deviceB:
So there are two devices with different object_id, but with the same deviceID.