runbox7 icon indicating copy to clipboard operation
runbox7 copied to clipboard

#Mail: Deleted messages reappear momentarily with local index

Open gtandersen opened this issue 1 year ago • 2 comments

Describe the bug When deleting a (significant) number of messages while using the local index, they disappear momentarily and then reappear until the messages have been deleted on the server (?).

To Reproduce Steps to reproduce the behavior:

  1. Go to https://runbox.com/app and ensure the local index is in use
  2. Click to select a (large) number of messages
  3. Click to delete
  4. Observe that the messages disappear for then to reappear, and then finally disappear again

Expected behavior The messages should immediately disappear for good.

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Firefox

gtandersen avatar Oct 09 '24 09:10 gtandersen

See also #1555

gtandersen avatar Oct 09 '24 09:10 gtandersen

This appears to be a timing issue: When running user changes (eg deleting messages), we ask the index worker to delete the data locally (from the browser copy of the index), which persists the changes to the indexdb, notifies the main thread to reload its copy of the index, which then redraws the list (so they disappear), while asking the api to delete the actual messages, which will eventually trigger an index update with the message removal from the backend.

This is while regular index updates are happening, so things may interleave rather than happen sequentially, so some of the messages (not always all of them!) reppear briefly, then disappear again.

castaway avatar Oct 09 '24 10:10 castaway

Possibly related to #863

gtandersen avatar Jan 04 '25 15:01 gtandersen

Not seen this recently.

gtandersen avatar Mar 04 '25 14:03 gtandersen