matrix-org / matrix-org/matrix-js-sdk

`updatePendingEvent` doesn't emit oldEventId to 'Room.localEchoUpdated' event.

Open
#645 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

T-Defect
Dominant language
TypeScript
Stars
2.2k
Forks
704
Avg merge
1d 20h
Merged PRs (30d)
40

Description

I have a situation that when I send a message using `sendMessage`, matrix client returns a matrix event with a temporary event id, the `Room.localEchoUpdated` gets fired when the message changing its status from `sending` to `sent`, however, I won't be able to get the temporary event id from `Room.localEchoUpdated`, that is, there is no way to connect the changed event.

Based on the matrix-js-sdk doc, the third parameter of [MatrixClient"Room.localEchoUpdated"](http://matrix-org.github.io/matrix-js-sdk/0.9.2/module-client.html#~event:MatrixClient%2522Room.localEchoUpdated%2522) should be oldEventId. However this line of code emits the newEventId since `event.getId()` returns the newEventId instead of the old one.
https://github.com/matrix-org/matrix-js-sdk/blob/4153845346c0d8ab087e0e6e854f6f75d744af6d/src/models/room.js#L820

I am not so sure whether it returns the `event.getId()` on purpose, if not, I can create a pr and fix this issue.

Thanks in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/models/room.js at the updatePendingEvent code linked in the issue, and inspect how Room.localEchoUpdated is emitted when a temporary event becomes sent. Confirm that the event reports the old temporary event ID rather than event.getId(); done means callers can connect the changed event to its temporary ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.