element-hq / element-hq/synapse
EventID does not represent event IDs of newer room versions
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#9777](https://github.com/matrix-org/synapse/issues/9777).
---
In the codebase, we have a type `EventID`. As of this day, it does not accurately represent event IDs. If I understand correctly, we have three different formats for event IDs and only one of them matches `EventID`. Attempting to shoehorn an event ID in another format into `EventID` turns out to be the wrong path. In other words, this is highly misleading.
I believe that we should fix `EventID` to accept these three formats and provide methods to ensure that the format is appropriate for a given context. The alternative would be to get rid of `EventID` and replace it with `str`.
Contributor guide
Research direction
Start by locating the EventID type and reviewing its call sites across the Synapse codebase. Determine how the three event ID formats should be represented and where each context requires validation. Done means EventID accurately represents all three formats and exposes checks for context-appropriate use, with corresponding tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100