Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync polls S3 twice a minute when there are no activity for 24 hours #7327

Open
AlexeyBarabash opened this issue Dec 11, 2019 · 0 comments
Open

Comments

@AlexeyBarabash
Copy link
Contributor

@AlexeyBarabash AlexeyBarabash commented Dec 11, 2019

Description

If Brave desktop browser has sync enabled, but there were no changes on synced objects, then data gets queried from AWS S3 storage and not from SQS.

This happens because the last bookmark operation time is may be older than 24 hours, and we pass the last record timestampt, so (currentTime - startAtToCheck) > 24 hours at https://github.com/brave/sync/blob/staging/client/requestUtil.js#L273

Steps to Reproduce

Option I, quick

  1. Establish the sync chain between two computers without bookmarks.
  2. Wait 5 minutes
  3. Open inspector for Brave Sync extension brave://inspect/#extensions, Sources tab, click Pretty print button
    image
  4. Find if (this.shouldListObject(startAt, category) || opts.compaction) { if (this.shouldListObject(startAt line and set the breakpoint on there
  5. Wait for the breakpoint gets hit
  6. Press F10 to make a step

Actual result:

  1. code executes if block const s3ObjectsPromise = s3Helper.listObjects(this.s3, options, !!maxRecords);
    image

Expected result:

6. Code should not go into `if` block

Option II, needs > 24h to see

  1. Establish the sync chain between two computers having some bookmarks.
  2. Wait more than 24h
  3. Go to step 3 of Option I.
    ..................
    6 Code should go into if block, as we want to fetch from S3

Reproduces how often:

Easily

Brave version (brave://version info)

Brave 1.0.1 Chromium: 78.0.3904.108 (Official Build) (64-bit)
Revision 4b26898a39ee037623a72fcfb77279fce0e7d648-refs/branch-heads/3904@{#889}
OS Linux

Version/Channel Information:

On any channel.

@AlexeyBarabash AlexeyBarabash self-assigned this Dec 11, 2019
@AlexeyBarabash AlexeyBarabash added this to Untriaged backlog in Sync via automation Dec 11, 2019
@darkdh darkdh moved this from Untriaged backlog to In progress in Sync Jan 8, 2020
@darkdh darkdh added this to Untriaged backlog in Sync - All platforms via automation Jan 8, 2020
@darkdh darkdh moved this from Untriaged backlog to In Progress in Sync - All platforms Jan 8, 2020
@darkdh darkdh removed this from In progress in Sync Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Sync - All platforms
  
In Progress
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.