fix: video recorder timer keeps running after leaving the room

TH
2d ago
+9251-5760

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

  1. Open a channel and start a video message.
  2. Allow the camera and click Record so the timer starts counting.
  3. Switch to another channel without clicking Cancel or Send.
  4. 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.