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

fix: bug- Audio recorder does not reset UI when a recording is taking place #14693 #32747

Conversation

akshat8605
Copy link
Contributor

@akshat8605 akshat8605 commented Apr 17, 2024

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #14693
or
Fixes #14693

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

media : https://www.loom.com/share/fb1c08173024427d96e483e782d41ee3?sid=49f2fdd8-ca3f-449f-ad09-aec8b294642a

Automation

/ok-to-test tags="@tag.Widget"

🔍 Cypress test results

Caution

If you modify the content in this section, you are likely to disrupt the CI result for your PR.

Summary by CodeRabbit

  • Bug Fixes
    • Updated the Audio Recorder Widget to reset the blob URL property to null after use, enhancing the control flow and logic for handling audio recordings.

Copy link
Contributor

coderabbitai bot commented Apr 17, 2024

Walkthrough

Walkthrough

The modification in the AudioRecorderWidget involves resetting the blobURL to null. This change is primarily aimed at addressing an issue where the UI did not reset correctly during an ongoing recording, potentially affecting the control flow and user interaction with the widget.

Changes

File Change Summary
app/client/src/widgets/AudioRecorderWidget/widget/index.tsx Reset blobURL to null in AudioRecorderWidget

Assessment against linked issues

Objective Addressed Explanation
Reset UI when recording is taking place (#14693)
Ensure UI changes occur on reset during recording (#14693)
Prevent recording continuation after reset (#14693) It's unclear if setting blobURL to null alone ensures recording stops.

Possibly related issues


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e07e3ec and c1e389a.
Files selected for processing (1)
  • app/client/src/widgets/AudioRecorderWidget/widget/index.tsx (1 hunks)
Additional comments not posted (1)
app/client/src/widgets/AudioRecorderWidget/widget/index.tsx (1)

262-262: Resetting blobURL to null to ensure UI consistency during recording.

Verification successful

Review Summary

The search results indicate that the blobURL property is used in multiple places within the AudioRecorderWidget and CameraWidget. In the AudioRecorderWidget, blobURL is used to manage the URL of the recorded audio, and it is appropriately handled with URL.revokeObjectURL to clean up resources. The property is set to null, undefined, or a new URL based on different conditions in the widget's lifecycle.

In the CameraWidget, blobURL is used in a similar context but for images and videos, and it is not directly related to the changes in the AudioRecorderWidget.

Conclusion

The change in the AudioRecorderWidget to reset blobURL to null during the recording start is consistent with the widget's management of this property. The usage of blobURL across the widget indicates that setting it to null is a part of the normal lifecycle to reset or clear the property when necessary. There are no indications from the search results that this change would negatively impact other functionalities within the widget or elsewhere in the application.

Actionable Directive:
The change is verified to be consistent with the existing management of blobURL in the AudioRecorderWidget. It is recommended to proceed with this change, and no further issues are found related to this modification.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that setting blobURL to null does not affect other functionalities.
# Search for usages of blobURL in the project to ensure there are no unintended side effects.
rg --type tsx --type ts "blobURL" 

Length of output: 61



Script:

#!/bin/bash
# Correcting the previous script to properly search for usages of "blobURL" in TypeScript and TSX files.
rg "blobURL" --type-add 'tsx:*.tsx' --type-add 'ts:*.ts' --type tsx --type ts

Length of output: 1559


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jsartisan
Copy link
Contributor

/build-deploy-preview skip-tests=true env=release

Copy link

Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8732915584.
Workflow: On demand build Docker image and deploy preview.
skip-tests: true.
env: release.
PR: 32747.
recreate: .

Copy link

Deploy-Preview-URL: https://appsmith-jjre9v7ui-get-appsmith.vercel.app

🚨 Note: The release environment runs EE code, so using a frontend-only DP on this repo, will
likely behave unexpectedly. Consider using a full DP instead.
Learn more.

@jsartisan
Copy link
Contributor

@somangshu PR looks good to me.

@somangshu
Copy link
Contributor

@jsartisan kindly run the test suit to be sure.

@somangshu somangshu changed the title [Bug]-[21]:Audio recorder does not reset UI when a recording is taking place #14693 fix: bug- Audio recorder does not reset UI when a recording is taking place #14693 Apr 18, 2024
@jsartisan
Copy link
Contributor

/ok-to-test tags="@tag.Widget"

Copy link

Whoops! Looks like you're using an outdated method of running the Cypress suite.
Please check this doc to learn how to correct this!

@jsartisan jsartisan added ok-to-test Required label for CI and removed ok-to-test Required label for CI labels Apr 18, 2024
@somangshu somangshu merged commit d163e55 into appsmithorg:release Apr 19, 2024
29 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]-[21]:Audio recorder does not reset UI when a recording is taking place
4 participants