Android app taking a while (15s) to sync after edits

Steps to reproduce

This seems to have started after updating to the latest version of the Android app a couple of days ago.

On the native Android app:

  1. Type a character in an item.
  2. Wait for syncing to complete.

Expected result

The sync completes soon after editing stops.

Actual result

It takes ~15s to sync.

See repro in this screen capture: https://streamable.com/clbcud

Some questions you might have:

Why does it matter that it takes 15s to sync?

The native Android app does not sync when backgrounded, so you must leave the app open until syncing completes (this is the reason I added custom CSS to display the sync status on the main screen). This means you now have to wait 15s before you can close/switch apps after making changes in Dynalist, which is a major pain. If you background the app (e.g. switch apps), it will only sync after you reopen the app. If you use Dynalist in Android Chrome it will sync in the background, oddly enough. See this screen capture for a demonstration of this: https://streamable.com/2uwwzn

Why don’t you use Dynalist in Android Chrome rather than the native app, since that syncs in background?

  1. I would prefer to use a dedicated native app
  2. The native app seems to scroll smoother on large documents.
  3. There’s currently a major bug when using Dynalist in Android Chrome, where adding a new item causes Chrome to crash, making it completely unusable right now: Creating new item on Android Chrome crashes Chrome this has been resolved!

Environment

Android 11, OnePlus 8T.

Is it still consistently happening? I feel like you’re running into one of those DB surges, since I don’t think we’ve adjusted the sync algorithm recently.

Yeah this seems to be happening pretty consistently. I’ve timed it a few times throughout the day today and it always takes between 14-17 seconds to sync. ~15s seems like a pretty high request p50 latency (or even p90, p99) for a simple single character letter write request.

…since I don’t think we’ve adjusted the sync algorithm recently.

Just want to point out the last Android app version was from November 2020, so any changes to the syncing algorithm in the last six months would be new relative to the latest Android app.

I want to point out that I think I’m seeing something similar on the web client as well, but I might not have noticed it previously since Chrome tabs can sync when backgrounded. After I make an edit the sync status changes to Sync now and when I look at the dev tools network tab nothing is being sent by the client. Then after ~15 seconds update and bundle_binary requests go out and it moves to synced very quickly after that. However, since the network tab can’t monitor socket connections maybe there’s some other communication going on that I can’t see.

I’m curious how much of the latency is coming from the request itself and how much is from the client “waiting” before sending out the update (maybe it has a periodic sync interval, or tries to optimistically wait to coalesce multiple writes into a single payload?).

Actually yeah you’re right, seems like I did touch a few timers when we had to optimize some of the sync issues about 2 months ago. The delay mostly come from the waiting on the client - the network side seems just fine. I can repro this delay on my dev setup as well.

I will try some tweaks to improve this, sorry about that!

2 Likes

Ok, I have an effective patch that reverts the sync timing back down to what it was before. Will be deployed in a few days with our end-of-month patches together.

2 Likes

Great, thanks!

Since this is really only a usability issue on the Android native app it would be great if the Google Play Store update for this version can be posted pretty quickly after release. Sometimes there’s a pretty long delay before the Android update goes out, so just want to make sure that’s on the radar for this particular release.

2 Likes