element-hq / element-hq/synapse

Synapse is a bit confused when searching for messages which have been edited

Open
#8,686 0 comments 0 reactions 0 assignees View on GitHub
A-Message-Search A-Search O-Occasional S-Minor T-Defect z-WTF
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#8686](https://github.com/matrix-org/synapse/issues/8686).

---

- Create an unencrypted room
- Send a message `foo`
- Search for `foo` (POST https://matrix-client.matrix.org/_matrix/client/r0/search) -> 1 result OK
- Edit the message from `foo` to `bar`
- Search for `bar` -> 1 result (`bar`) -> OK
- Search for `foo` -> 1 result (`bar`) -> KO

In Element Web:

image

Another scenario:
- Send a message `foo test`
- Search for `test` (POST https://matrix-client.matrix.org/_matrix/client/r0/search) -> 1 result OK
- Edit the message from `foo test` to `bar test`
- Search for `test` -> 2 results -> KO

I'm not sure about what is the proper fix, but I guess Synapse should only return the latest version of a message, and only if it contains the searched terms.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.