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

Fixed DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. #8166

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

bsekachev
Copy link
Member

@bsekachev bsekachev commented Jul 15, 2024

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a DOMException related to the execution of atob on Window, resolving issues with decoding incorrectly encoded strings.
    • Added a missing return statement within a promise resolve block to correct control flow in specific conditions.

Copy link
Contributor

coderabbitai bot commented Jul 15, 2024

Walkthrough

The changes address a DOMException related to the atob function on Window, fixing the decoding of incorrectly encoded strings. Additionally, a return; statement was added within a promise resolve block in cvat-ui/plugins/sam/src/ts/index.tsx, altering the control flow to handle specific conditions appropriately.

Changes

File Path Change Summary
changelog.d/20240715_111454_boris_missing_return.md Added a new changelog entry regarding a fix for a DOMException related to atob on Window.
cvat-ui/plugins/sam/src/ts/index.tsx Added a return; statement within a promise resolve block, changing the control flow under certain conditions.

Poem

In code's vast, intricate maze,
A DOMException we did faze,
With atob now set just right,
Strings decode, smooth as night.
And in a promise softly spun,
A return ensures it's properly done.
Cheers to fixes, big or small,
Making software stand tall! 🐇✨


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.

@bsekachev bsekachev requested a review from nmanovic as a code owner July 15, 2024 08:15
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2aa4ebd and e212410.

Files selected for processing (2)
  • changelog.d/20240715_111454_boris_missing_return.md (1 hunks)
  • cvat-ui/plugins/sam/src/ts/index.tsx (1 hunks)
Files skipped from review due to trivial changes (2)
  • changelog.d/20240715_111454_boris_missing_return.md
  • cvat-ui/plugins/sam/src/ts/index.tsx

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.38%. Comparing base (9565cff) to head (e212410).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8166      +/-   ##
===========================================
- Coverage    83.43%   83.38%   -0.05%     
===========================================
  Files          388      388              
  Lines        41272    41273       +1     
  Branches      3852     3852              
===========================================
- Hits         34435    34417      -18     
- Misses        6837     6856      +19     
Components Coverage Δ
cvat-ui 79.64% <0.00%> (-0.10%) ⬇️
cvat-server 86.75% <ø> (-0.01%) ⬇️

@bsekachev bsekachev merged commit f078458 into develop Jul 15, 2024
33 checks passed
@bsekachev bsekachev deleted the bs/missing_return branch July 15, 2024 09:32
@cvat-bot cvat-bot bot mentioned this pull request Jul 15, 2024
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.

2 participants