matrix-js-sdk icon indicating copy to clipboard operation
matrix-js-sdk copied to clipboard

Fix sending when pending event exists

Open hannojg opened this issue 4 years ago • 5 comments

Reproduction / Use case

I was trying to implement the "sending of voice message". I am:

  • (creating a voice record)
  • calling room.addPendingEvent, so a local message with the state being "sending" is shown to the user (UX: immediate feedback after stopping the recording). I create a dummy event with a txnId.
  • uploading the voice record file
  • sending an audio message using the txnId of the dummy event (and the content URL received from the upload)

The issue

When sending the audio message event with the same txnId of the event we added earlier as pending the sending of the whole event will fail, as (the changed code line) will throw that the event already exists. It's fine that it exists and it should proceed.

Side note: There is a different issue that prevents the above-described flow/reproduction from working. The fix is in this PR.

Signed-off-by: Hanno Gödecke [email protected]


This PR currently has no changelog labels, so will not be included in changelogs.

A reviewer can add one of: T-Deprecation, T-Enhancement, T-Defect, T-Task to indicate what type of change this is, or add Type: [enhancement/defect/task] to the description and I'll add them for you.

hannojg avatar Apr 15 '21 19:04 hannojg

@hannojg, thanks for working on this! Could you please include a sign-off as described here?

SimonBrandner avatar Apr 16 '21 05:04 SimonBrandner

did something change? 😅 not sure if I did it correctly

hannojg avatar Apr 16 '21 05:04 hannojg

I don't think anything did. You can just add this to your PR description:

Signed-off-by: Your Name <[email protected]>

SimonBrandner avatar Apr 16 '21 05:04 SimonBrandner

no, but i can create a local reproduction if that helps?

hannojg avatar Apr 22 '21 06:04 hannojg

A minimal case would help too, yea

turt2live avatar Apr 22 '21 13:04 turt2live

Closing as abandoned

t3chguy avatar Jul 20 '23 14:07 t3chguy