element-hq / element-hq/element-web
Exceptions during room view changes cause infinite, unrecoverable, loops
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.8k
- PR merge metrics
- PR metrics pending
Description
### Steps to reproduce
1. Throw an error in a relatively sane place, such as an `undefined` event that https://github.com/matrix-org/matrix-react-sdk/pull/6733 patched over.
2. Trigger the error
### What happened?
### What did you expect?
For the client to not spin out of control. We should have handling to ensure that rapid loops don't happen, failing outright to an error page instead of reverting `view_room` dispatches. Ie: we should redirect to `#/error` or something to break loops.
### What happened?
It spun out of control. The room view switch logic got caught in a predictable race with the space change handling: the user would navigate to an affected room which triggers the space change handling to try and navigate to the relevant space for that room, but before that space change dispatch could go off the room view errors and causes some code somewhere to revert the room view change. The reversion then gets caught by the space change handling again, so is now racing between two dispatches which have become out of phase with each other. Repeats infinitely.
### Operating system
Windows 10
### Application version
N/A - All platforms
### How did you install the app?
_No response_
### Homeserver
_No response_
### Have you submitted a rageshake?
No
Contributor guide
Assessment
This issue has not been assessed yet.