element-hq / element-hq/element-web
Seshat may sometimes show redacted messages in results.
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
1. Alice sends a message to a room.
2. Much later, she redacts it.
3. A little later, Bob searches that room for that message via seshat
4. Bob's ED shows the message in the results
5. He clicks on it, and gets permalinked to the correctly redacted message.
6. He then re-searches for the original message, and nothing comes up.
### Outcome
#### What did you expect?
Redacted messages should never show up in search results.
#### What happened instead?
My best guess is that the redaction landed in a gappy sync on Bob's client. Bob's seshat then took a while to spider the gap and find the redaction and apply it. Meanwhile, it turned up in search results. However, once he'd permalinked to it, his client called /context and /messages to display the timeline, and so correctly loaded the redacted message, after which point the redaction was applied and Seshat no longer displayed it in search results.
I'm a bit surprised that the redaction fell into a gap on Bob's side though. And i'm surprised that his seshat didn't rapidly find and apply it. So perhaps his seshat had got stuck? If so, hopefully that would get fixed by https://github.com/element-hq/element-web/pull/33955.
One other factor is that Alice's redacted message had been edited - and Bob could see both the original followed by the edit-fallback in his results at first. However, I think this is a red herring - even though the edited versions will not have been redacted from the room (given MSC3912 has never rolled out), Seshat apparently never returns edits in results anyway (c.f. https://github.com/element-hq/element-web/issues/32356).
### Operating system
macOS
### Application version
1.12.21
### How did you install the app?
_No response_
### Homeserver
matrix.org
### Will you send logs?
No
Contributor guide
Research direction
Start by tracing Seshat's search indexing and redaction handling, then reproduce the sequence using a gappy sync. Compare search results before and after /context and /messages load the event; done means redacted messages never appear in Seshat results, including while the redaction is still being discovered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100