fix: video recorder timer keeps running after leaving the room
TH
2d ago+9251+9251+0123456789012345678901234567890123456789-5760-5760-0123456789012345678901234567890123456789
Proposed changes (including video)
Leaving a room while a video message is recording unmounts the recorder dialog, but the one-second clock timer keeps running and the recording activity is never stopped.
The timer id is now kept in a ref and cleared on unmount, and UserAction.stop is called for that room. Cancel and Send use the same stop path.
A screen recording of the bug is attached.
Issue(s)
https://github.com/user-attachments/assets/60bfd97f-d089-4d7c-b615-ae69c7ff2a7a
Fixes #43588
Steps to test or reproduce
- Open a channel and start a video message.
- Allow the camera and click Record so the timer starts counting.
- Switch to another channel without clicking Cancel or Send.
- The timer should stop, and another user should no longer see you as recording.
Summary by CodeRabbit
- Bug Fixes
- Improved video message recording cleanup so user activity ends when a recording is stopped or the recorder is closed, helping prevent activity indicators from remaining active after recording ends. Timer cleanup is also handled consistently during these transitions.