Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent double-click recorder bug #3414

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Oct 31, 2024

Fixes #3411 and prevents trying to upload an empty audio file.

Stress-test with rapid repeated clicks on the same record button. Then pause a do a normal recording on the same button.


This change is Reviewable

@imnasnainaec imnasnainaec added bug Something isn't working frontend audio labels Oct 31, 2024
@imnasnainaec imnasnainaec self-assigned this Oct 31, 2024
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 12 lines in your changes missing coverage. Please review.

Project coverage is 74.59%. Comparing base (e349e02) to head (b87eca6).
Report is 15 commits behind head on master.

Files with missing lines Patch % Lines
src/components/Pronunciations/AudioRecorder.tsx 23.07% 10 Missing ⚠️
src/components/Pronunciations/RecorderIcon.tsx 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3414      +/-   ##
==========================================
- Coverage   74.63%   74.59%   -0.04%     
==========================================
  Files         285      285              
  Lines       10978    10987       +9     
  Branches     1335     1337       +2     
==========================================
+ Hits         8193     8196       +3     
- Misses       2401     2407       +6     
  Partials      384      384              
Flag Coverage Δ
backend 83.62% <ø> (+0.07%) ⬆️
frontend 66.55% <25.00%> (-0.13%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -34,6 +45,8 @@ export default function AudioRecorder(props: RecorderProps): ReactElement {
// Prevent starting a recording before a previous one is finished.
await stopRecording();

setClicked(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is after an await it's possible that the user clicks it in-between no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point.

@imnasnainaec imnasnainaec marked this pull request as ready for review November 1, 2024 16:08
@imnasnainaec imnasnainaec requested a review from hahn-kev November 4, 2024 20:27
Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2, all commit messages.
Dismissed @hahn-kev from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @hahn-kev)

@imnasnainaec imnasnainaec merged commit a4aa54c into master Nov 5, 2024
18 checks passed
@imnasnainaec imnasnainaec deleted the bugfix/audio-double-click branch November 5, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio bug Something isn't working frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A double-click on the record icon can disable recording
3 participants