runbox7 icon indicating copy to clipboard operation
runbox7 copied to clipboard

App hangs on index synchronization

Open gtandersen opened this issue 3 years ago • 4 comments

Since the fixes to correct the unread message counters in the folder list, the app hangs for a short while on every index synchronization.

The severity is proportional with the number of messages and/or folders, and in large accounts the app will not react for several seconds on each sync.

Related Github issues:

  • Unread message counters are unreliable: https://github.com/runbox/runbox7/issues/512
  • Fast and correct folder counters: https://github.com/runbox/runbox7/pull/513
  • Make sure we show folder counts correctly for folders not available in local index: https://github.com/runbox/runbox7/pull/639
  • Only recount folder unread counts after content change: https://github.com/runbox/runbox7/pull/653

Possibly related comment: https://community.runbox.com/t/runbox-7-webmail-bugs-that-really-annoy-me/1211/15

gtandersen avatar Jul 29 '20 15:07 gtandersen

https://github.com/runbox/runbox7/pull/665 (currently secretly deployed as runbox7-beta) cuts the folder counters down by an order of magnitude, but it may still not be enough especially on slower devices, like phones.

We may want to consider doing that in a separate thread (using https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers), which should eliminate the hangs even if the operation itself remains slow.

tadzik avatar Jul 30 '20 09:07 tadzik

There is still some lag on message actions, so performing synchronization in a separate thread sounds like a good idea.

Another idea is to only synchronize folder counts after a period of inactivity (say 10 minutes) and in the meantime calculate counts locally by adding and subtracting upon each message action.

gtandersen avatar Oct 19 '20 10:10 gtandersen

This seems better now but very variable. See also #483 (closed).

gtandersen avatar May 28 '21 20:05 gtandersen

See also internal issue 1156.

gtandersen avatar Aug 18 '21 11:08 gtandersen

This appears to no longer occur.

gtandersen avatar Dec 15 '22 10:12 gtandersen