brave-browser: [Android] Sync v2 takes too long to auto-update after waking phone up from sleep

Description

I’ve noticed that Brave on Android is frequently behind on sync updates and takes anywhere from 1-5 minutes after launching Brave before re-attempting sync. This makes sync features like Send tab to device and Open Tabs Sync almost unusable. This most frequently occurs after not using Brave for a few minutes or when the phone has been asleep for a while.

When Brave is in this state, chrome://sync-internals reports NETWORK_CONNECTION_UNAVAILABLE with a retry time that is often before the current system time. See the screenshot below

Steps to reproduce

  1. Make sure Brave isn’t active by going to the phone’s home screen.
  2. Turn off the phone screen and let it go to sleep.
  3. Wait 15 minutes (could be shorter, but just playing it safe).
  4. Turn on the phone screen and launch Brave.
  5. Immediately go to chrome://sync-internals
  6. Note that what you see is similar to the below screenshot.
  7. During this time, try to send a tab or two to your phone via desktop Brave.
  8. Note that the Send to device tab notification does not appear on the phone.
  9. Wait for a few minutes for Brave to auto-initiate a sync update
  10. Note that all pending Send to device tab notifications appear all at once.

Actual result

Sending a tab to my Android device frequently takes anywhere from 1-5 minutes because of the issue in the screenshot below. signal-2020-09-14-145330

Expected result

Sending a tab to Android should trigger an immediate Sync update on my phone and show tab notifications. I should not have to browse to chrome://sync-internals and manually trigger an update. This is poor UX.

Issue reproduces how often

Easily reproduced

Version/Channel Information:

  • Can you reproduce this issue with the current Play Store version? Yes
  • Can you reproduce this issue with the latest stable Github build? Yes
  • Can you reproduce this issue with the current Play Store Beta version? Not tested
  • Can you reproduce this issue with the current Play Store Nightly version? Not tested

Device details

  • Install type (ARM, x86): ARM
  • Device type (Phone, Tablet, Phablet): Pixel 2XL Phone
  • Android version: 11

Brave version

1.13.87

Website problems only

  • Does the issue resolve itself when disabling Brave Shields? No
  • Does the issue resolve itself when disabling Brave Rewards? No
  • Is the issue reproducible on the latest version of Chrome? No

Additional information

I believe this is at the core of some of the other tab sync issues, like #10707

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 7
  • Comments: 24 (7 by maintainers)

Most upvoted comments

I am now getting SERVER_RETURN_TRANSIENT_ERROR on at least one of my devices every other day. It makes Sync horribly unreliable. Has there been any progress on this?

Today I encountered this bug on my Surface Pro Windows tablet, except that it never seems to come out of Backed off state even after waiting for several minutes. Sync is much slower. Now it takes about the same amount of time to send a tab between my PC and my tablet as it does between my PC and my Android device. This was not the case before when brave://sync-internals reported everything was normal.

I have a feeling Sync v2 doesn’t handle devices coming back from sleep very well. To fix the issue below, I had to leave the sync chain on my tablet and rejoin. The SERVER_RETURN_CONFLICT message in Commit Step Result seems like the main culprit.

Untitled

Marking P2 because I have now the profile with exactly the same problem.

I have this issue happening…always. The tab takes about a couple of minutes to “arrive” between devices. Every. Time.

And, seeing that there are so many other people mentioning this, I wouldn’t discard this issue so quickly.

I’m on macOS and Android. Is there anything I can do to try to fix this on my end?

Thanks!

it was working fine on windows machine (3 windows 10 desktops). then I recently added and android device and now I get SERVER_RETURN_CONFLICT errors.