feat: add warnings when image upload fails during todo operations#24
feat: add warnings when image upload fails during todo operations#24jezweb wants to merge 1 commit intoifindev:mainfrom
Conversation
- Import cookies() in create-todo and update-todo actions - Set 'todo-warning' cookie when R2 upload fails - Create WarningToast component to display cookie-based warnings - Integrate WarningToast into todo-list page - Clear warning cookie after displaying Now users see: 'Image upload failed, but todo was created/updated successfully' when R2 upload fails but todo operation succeeds. Prevents silent failures.
|
Warning Rate limit exceeded@jezweb has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 0 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (7)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Summary
Provides clear user feedback when R2 image upload fails but the todo creation/update succeeds.
Problem
Previously, if image upload to R2 failed, the error was only logged to console. Users would see "Todo created successfully!" even though their image didn't upload - a silent failure.
Solution
todo-warningcookie when R2 upload failsWarningToastclient component checks and displays the warningChanges
User Experience
Before: Image fails to upload → "Todo created successfully!" → user doesn't know image is missing⚠️ Image upload failed, but todo was created successfully"
After: Image fails to upload → "Todo created successfully!" → "
Technical Approach
Using cookies to pass warnings from server actions to client:
todo-warningcookie (10s expiry)Alternative approaches considered:
Testing
Prevents silent image upload failures.