Skip to content

Conversation

@aaryan610
Copy link
Member

@aaryan610 aaryan610 commented Dec 30, 2025

Description

This PR removes the hardcoded image uploader error state.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

Bug Fixes

  • Fixed image uploader error handling to accurately display errors. Error messages and styling now correctly reflect actual loading failures and duplication issues, rather than displaying in all scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 30, 2025 08:58
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

The uploader component's error state was refactored from a hardcoded constant to dynamic computation. The isErrorState now evaluates based on actual conditions: image load failures or duplication failures, enabling proper error styling and messaging behavior.

Changes

Cohort / File(s) Summary
Error state logic fix
packages/editor/src/core/extensions/custom-image/components/uploader.tsx
Changed isErrorState from a forced constant to dynamic computation using failedToLoadImage || hasDuplicationFailed. Affects error styling, message rendering, and retry handling to reflect actual error conditions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A carrot-hoppin' fix, I must say,
Error states weren't truthful yesterday!
Now when images fail or duplicate appears,
The uploader knows—no more false fears! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive The description is incomplete. While it identifies the bug fix type, it lacks detailed information about the problem, solution, test scenarios, and media. Expand the description to explain what the hardcoded error state was, why it caused a regression, how the fix works, and include test scenarios demonstrating the fix.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: fixing a regression in the image uploader's error state handling by replacing a hardcoded true value with dynamic computation.
✨ Finishing touches
  • 📝 Generate docstrings

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression in the image uploader component by removing a hardcoded error state that was causing the uploader to always display as if it were in an error condition.

  • Removes hardcoded isErrorState = true and restores proper error state logic based on actual failure conditions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pushya22 pushya22 changed the title regression: image uploader error state [WEB-857] regression: image uploader error state Dec 30, 2025
@pushya22 pushya22 merged commit 031baaa into preview Dec 30, 2025
17 of 18 checks passed
@pushya22 pushya22 deleted the fix/image-uploader-error branch December 30, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants