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

Error: [Immer] This object has been frozen and should not be mutated.

Open
#3,742 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I get this error with the following steps:-

- Send a normal message event in a room with the sendEvent method
![image](https://github.com/matrix-org/matrix-js-sdk/assets/106071580/19c16e18-3e3e-46a8-88cf-9c40f8cb4dc3)

- Edit the event by changing its content and also add rel_type as m.replace and pass eventId of edited event
![image](https://github.com/matrix-org/matrix-js-sdk/assets/106071580/11ae78f9-098b-4e80-ae3d-35b089a6c045)

- Now try to do a reaction on the same edited event like this
![image](https://github.com/matrix-org/matrix-js-sdk/assets/106071580/2c99f32a-a10b-4a7b-a84e-ccde93d9e4f7)

- And also in vice versa case first we do a reaction and then try to edit the message in that case also we get the same error.

Then it gives this error **Error: [Immer] This object has been frozen and should not be mutated.**

If more information is needed I can provide it.

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

Reproduce the failure through the sendEvent flow using an edited event and a reaction, testing both operation orders described in the report. Trace the event-edit and reaction entry points to identify where the frozen object is mutated. Done means both sequences complete without the Immer mutation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.