Skip to content
This repository was archived by the owner on Jul 31, 2020. It is now read-only.

Introduce device id v2 - #362

Merged
bridiver merged 5 commits into
stagingfrom
dup-device-id
Dec 23, 2019
Merged

Introduce device id v2#362
bridiver merged 5 commits into
stagingfrom
dup-device-id

Conversation

@darkdh

@darkdh darkdh commented Dec 6, 2019

Copy link
Copy Markdown
Member

fix #333

This PR introduce device id v2 which is a 3 random bytes hex encoded string.
We also keep device id for backward compatibility.
Migration from existing device would be:

  1. There will be extra SAVE_INIT_DATA for updating device id v2
  2. Create new SQS queues using device id v2 and subscribe to old SQS queues created by device id
  3. We will fetch from both queues for 24 hours and then delete the old queues

@darkdh
darkdh force-pushed the dup-device-id branch 3 times, most recently from 109cdd6 to 275c5f2 Compare December 9, 2019 04:09
fix test

add comments
@darkdh darkdh self-assigned this Dec 9, 2019
@darkdh
darkdh marked this pull request as ready for review December 10, 2019 08:55
Comment thread client/requestUtil.js
return s3Helper.listNotifications(
this.sqs, notificationParams, category, prefix).then((values) => {
if (this.shouldRetireOldSQSQueue(parseInt(values.createdTimeStamp))) {
return this.deleteSQSQueue(this.oldSQSUrlByCat[category]).then(() => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexeyBarabash reminded me that when device id is duplicated, if there is an old Brave which doesn't contain the fix, its SQS queue will be unavailable until next relaunch because upgraded Brave deletes it after 24 hours

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused and I thought this.deleteSQSQueue can delete queues belonging to other devices. And like @darkdh mentioned that only can happen if device id was duplicated. Which is a separate case.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non upgraded device will get reset anyway, so duplicate case won’t be an issue

@SergeyZhukovsky SergeyZhukovsky left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@AlexeyBarabash

Copy link
Copy Markdown
Contributor

Minor notice
4e5ed88 may be squashed before merge, unless there is a hope it will be helpful somehow.

All the rest looks good.

@AlexeyBarabash AlexeyBarabash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

@bridiver
bridiver merged commit aed5381 into staging Dec 23, 2019
bridiver added a commit to brave/brave-core that referenced this pull request Dec 26, 2019
darkdh pushed a commit that referenced this pull request Dec 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two different devices in same chain with same id

4 participants