Skip to content

fix: disable send until video is recorded#38731

Open
ScriptShah wants to merge 1 commit intoRocketChat:developfrom
ScriptShah:fix/video-message-recorder-send-disabled
Open

fix: disable send until video is recorded#38731
ScriptShah wants to merge 1 commit intoRocketChat:developfrom
ScriptShah:fix/video-message-recorder-send-disabled

Conversation

@ScriptShah
Copy link
Contributor

@ScriptShah ScriptShah commented Feb 16, 2026

Proposed changes (including videos or screenshots)

This PR fixes a UX and data integrity issue in the video message recorder where the Send button is enabled even when no recording has been made. Clicking Send immediately can result in an upload attempt of a 0-byte blob or unexpected message behavior.

File:
apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx

Previously, the disabled state of the Send button only checked whether the camera was started and whether the user was not currently recording. This allowed the initial idle state (before any recording) to still enable Send.

This PR updates the disabled condition to ensure that:

  • The camera is started
  • The recording state is idle
  • A recording has actually occurred (using time as the signal)

Code change

- const sendButtonDisabled = !(VideoRecorder.cameraStarted.get() && !(recordingState === 'recording'));
+ const sendButtonDisabled = !VideoRecorder.cameraStarted.get() || recordingState !== 'idle' || !time;

📸 Screenshots:

(Will be added) Recorder UI showing Send enabled before recording
image

(Will be added) Recorder UI showing Send disabled until recording exists
Screenshot from 2026-02-16 20-45-37

This is a minimal, safe change that prevents empty uploads and improves UX consistency.

Issue

Fixes #38729

Steps to test or reproduce

Open the video message recorder in the message composer.

Do not record anything.

Observe the Send button state.

Before fix:

Send can be enabled even if no recording has been made.

Clicking Send may trigger an empty upload attempt.

After fix:

Send remains disabled until a recording has occurred (time is set).

No empty uploads are possible.

Further comments

This fix prevents unintended empty video uploads and ensures that the Send button reflects actual recording state. It does not introduce new UI behavior and does not require a changeset, as it only corrects incorrect button state logic.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the Send button behavior in the video message recorder to better handle edge cases during recording. The button now correctly disables when the camera hasn't started, recording is still in progress, or no content has been recorded yet.

@ScriptShah ScriptShah requested a review from a team as a code owner February 16, 2026 17:25
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Feb 16, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

⚠️ No Changeset found

Latest commit: 44be856

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 508b4a1 and 44be856.

📒 Files selected for processing (1)
  • apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
🔇 Additional comments (1)
apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx (1)

50-50: LGTM — the new disabled condition correctly gates the Send button.

The disjunction properly ensures all three prerequisites are met: camera started, recording state is idle (not loading or actively recording), and time is truthy (meaning a recording has actually occurred and been stopped). The state transitions in handleRecord and stopVideoRecording keep these values consistent throughout the lifecycle.


Walkthrough

A single-line logic fix in the Video Message Recorder component corrects the Send button's disabled state. The button now properly remains disabled when the camera is not started, the recording is not idle, or no recording time has been captured, preventing users from sending empty video messages.

Changes

Cohort / File(s) Summary
Send Button Logic Fix
apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx
Updated sendButtonDisabled condition from a conjunction to a disjunction that checks three conditions: camera not started, recording state not idle, or no recorded time, preventing Send when no actual recording exists.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A button that danced without reason or care,
Now frozen in place till a video is there,
No phantom sends of empty space,
A proper recorder at last finds its place! ✨

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: disable send until video is recorded' clearly and concisely describes the main change—preventing the Send button from being enabled without a recording.
Linked Issues check ✅ Passed The PR implements the exact fix specified in issue #38729: updating sendButtonDisabled logic to require camera started, idle recording state, and recorded time.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the Send button disabled logic in the VideoMessageRecorder component as required by issue #38729.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into develop

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.49%. Comparing base (508b4a1) to head (44be856).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38731      +/-   ##
===========================================
- Coverage    70.51%   70.49%   -0.02%     
===========================================
  Files         3176     3176              
  Lines       111139   111138       -1     
  Branches     20050    20042       -8     
===========================================
- Hits         78367    78351      -16     
- Misses       30721    30736      +15     
  Partials      2051     2051              
Flag Coverage Δ
unit 71.47% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Video Message Recorder: “Send” enabled without recording

1 participant