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

fix(threading): Handle threads with duplicate send times #10176

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ChristophWurst
Copy link
Member

A thread with two messages with identical sent_at result in a problematic situation. The backend will return both messages when listing the inbox. The front-end will de-duplicate and only show one of the two. At every browser-server sync, the picked duplicate will be replaced by the other message. At the next sync they are replaced again. Etc. This causes endless notifications.

I ran into this with a thread for an outgoing message that was replied to by the mail server. This seems to be the rare case where two messages in a thread have an identical send time because they were processed in the same second.

How to test

  1. Create a thread with two messages
  2. Go into the database, find the thread and change send_at to be identical for both messages
  3. Reload the app
  4. Wait for the sync

main: the two messages toggle.
here: only one of the messages is loaded and never replaced.


Note: I can't come up with a good way to find out which of the messages with identical send time are "newer". I just sort them by message id. It's a bit "random" semantically but keeps the sorting stable.

@ChristophWurst ChristophWurst added bug 3. to review feature:threading papercut Annoying recurring issue with possibly simple fix. labels Sep 19, 2024
@ChristophWurst ChristophWurst self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug feature:threading papercut Annoying recurring issue with possibly simple fix.
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

2 participants