matrix-org / matrix-org/matrix-js-sdk
Consider deprecating the `event` emit event due to confusion
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 704
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 40
Description
It conflates all sorts of events, presence, room account data, timeline, state and is just generally not helpful.
It seemingly wants to be a catch-all but doesn't include (user) account data - that's only available on the `accountData` emit
`callEventHandler` and the effects code in react-sdk's `RoomView` both listened to it instead of Room.timeline which is far more appropriate for their uses.
Can anyone see a use-case for this instead of just listening on `['User.lastPresenceTs', 'Room.timeline', 'RoomMember.typing', 'Room.receipt', 'Room.accountData']`
Maybe we should add one for `Room.ephemeralEvent` to catch ones which aren't typing/receipts for flexibility out-of-spec.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the `event` listeners in `callEventHandler` and the effects code in react-sdk's `RoomView`, then compare their needs with `Room.timeline`. Review the listed event names and determine whether `event` has a remaining use-case or whether a `Room.ephemeralEvent` alternative is needed. Done means reaching and documenting a clear deprecation or retention decision.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100