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

Messages sent to a thread aren't visible in EW but appear in previews #26254

Closed
ara4n opened this issue Sep 28, 2023 · 13 comments · Fixed by matrix-org/matrix-js-sdk#3787
Closed
Labels
A-Threads A-Timeline O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Critical Prevents work, causes data loss and/or has no workaround T-Defect X-Regression

Comments

@ara4n
Copy link
Member

ara4n commented Sep 28, 2023

Steps to reproduce

  1. See a thread on EX
  2. Reply to a message in it
  3. View the same thread on EW
  4. Your replies are missing entirely from the thread:

EW shows:

Screenshot 2023-09-28 at 09 53 10

EX shows:

IMG_3108

Unclear on whether this is an EX or EW or Synapse bug.

Will rageshake on both platforms with msg IDs.

Outcome

What did you expect?

Messages should never disappear.

What happened instead?

Messages disappeared.

Operating system

No response

Application version

Element Nightly version: 2023092701 Olm version: 3.2.14

How did you install the app?

No response

Homeserver

matrix.org

Will you send logs?

Yes

@ara4n ara4n added the T-Defect label Sep 28, 2023
@t3chguy
Copy link
Member

t3chguy commented Sep 28, 2023

image

Cannot reproduce

@ara4n
Copy link
Member Author

ara4n commented Sep 28, 2023

unsurprised. hopefully my EW rageshake might reveal what's going on. (also, hello nunito!)

@ara4n
Copy link
Member Author

ara4n commented Sep 28, 2023

looks like it's not only my messages. just found a threaded message for another room which shows in the room preview, but isn't visible anywhere in the actual room, or the thread it was a member of.

@ara4n
Copy link
Member Author

ara4n commented Sep 28, 2023

having restarted the client, the missing messages are now visible.

@andybalaam
Copy link
Contributor

I see a missing message this morning:

image

It's visible in the main timeline, but not the thread.

@andybalaam
Copy link
Contributor

^ Rageshake added.

@andybalaam
Copy link
Contributor

Treating this as a "fire" i.e. something that we immediately work on.

@andybalaam andybalaam added S-Critical Prevents work, causes data loss and/or has no workaround O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience A-Threads A-Timeline labels Oct 5, 2023
@andybalaam
Copy link
Contributor

Theory so far: maybe the message never got added to the thread timeline, maybe because it was not in the order we expected.

Ideas here: matrix-org/matrix-js-sdk#3782

Next: figure out whether the missing messages arrived via sync and/or relations api.

@andybalaam
Copy link
Contributor

In my example, the messages were sent from Element Desktop.

@andybalaam andybalaam changed the title Messages sent in reply to a thread on EX aren't rendered at all on EW Messages sent a a thread aren't visible in EW but appear in previews Oct 6, 2023
@andybalaam
Copy link
Contributor

OK, I have hatched a plan. We suspect that the problem is messages being dropped in Thread::addEvent, and the main suspect of why they might be dropped is due to their localTimestamp being inconsistent with the order we receive them. This could happen for example if some messages arrived via sync and others via the relations API.

Until we have MSC4033, we can't definitively solve the message-ordering problem, but we can see some problems in addEvent that we can handle in a way that might be better.

We need to be very cautious around this area because if we change the order of messages we can trigger new forms of the Stuck Notifications bug.

So the plan is:

  • Add a warning message when we drop events in this code, providing the information about why we dropped them.
  • Prepare a PR that improves the behaviour of addEvent to remove use of localTimestamp (which we think is simply wrong) and insert every message, relying on server timestamps to put them in the "right" order (See Several places in the code use timestamp to determine event order matrix-org/matrix-js-sdk#3325).
  • Merge this PR after the next release candidate so we can observe whether people experience more stuck unreads, and back it out if they do.

andybalaam added a commit to matrix-org/matrix-js-sdk that referenced this issue Oct 6, 2023
github-merge-queue bot pushed a commit to matrix-org/matrix-js-sdk that referenced this issue Oct 6, 2023
github-merge-queue bot pushed a commit to matrix-org/matrix-js-sdk that referenced this issue Oct 6, 2023
github-merge-queue bot pushed a commit to matrix-org/matrix-js-sdk that referenced this issue Oct 9, 2023
* Warn when we drop an event trying to add it to a thread

Added to try and help debug element-hq/element-web#26254

* Comment trying to explain lastEvent

* Document some of my understanding of the addEvent logic

* Refer to stable spec instead of MSC

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>

* Re-word comments based on review

---------

Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
@grati-cule
Copy link

Hi, I've noticed in one of my rooms that I'm not receiving some individual messages on Element (Windows and Android) which are appearing on Element X (Android)

I've submitted feedback via Element on my laptop but am providing screenshots here...

Screenshot_20231010-094840~2
Screenshot_20231010-094940

@grati-cule
Copy link

Here are screenshots for my Element (Windows) session showing where the messages should be...

Screenshot 2023-10-10 095409a Screenshot 2023-10-10 094834a

@andybalaam andybalaam changed the title Messages sent a a thread aren't visible in EW but appear in previews Messages sent to a thread aren't visible in EW but appear in previews Oct 16, 2023
@andybalaam
Copy link
Contributor

We believe this is fixed (planned for the release in early November, probably Element Web v1.11.48). If you see any examples of it, please re-open this issue or create a new one if the behaviour is different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Threads A-Timeline O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Critical Prevents work, causes data loss and/or has no workaround T-Defect X-Regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants