Skip to content

Fix React error #31 on admin rebuild image button#545

Merged
frostebite merged 1 commit intomainfrom
fix/admin-rebuild-toast-render-error
Mar 20, 2026
Merged

Fix React error #31 on admin rebuild image button#545
frostebite merged 1 commit intomainfrom
fix/admin-rebuild-toast-render-error

Conversation

@frostebite
Copy link
Member

@frostebite frostebite commented Mar 20, 2026

Summary

  • The admin "retry build" button on the Docker versions page crashes with React error Add buildVersion output documentation #31 ("Objects are not valid as a React child")
  • The retryBuild API returns { message, description }, but the toast success handler was passing the entire object to react-hot-toast instead of extracting the string
  • Fixed by changing (message) => message to (response) => response.message

Test plan

  • Log in as admin and navigate to Docker versions page
  • Click the retry/rebuild button on a failed build
  • Verify the success toast renders the message string instead of crashing

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed success notification messaging in the Docker image feature to correctly display server response information.

The retryBuild API returns a JSON object { message, description }, but
the toast success handler was passing the entire object as a React child.
Extract response.message so react-hot-toast receives a renderable string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

Cat Gif

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

Updated a notification success handler in a Docker image component to access the message field directly from the response object instead of using a prior parameter reference, affecting only one line of code.

Changes

Cohort / File(s) Summary
Notification Handler Update
src/components/docs/versions/docker-image-link-or-retry-button.tsx
Modified notify.promise success callback to use response.message instead of the parameter-based message value, ensuring the handler reads the message directly from the resolved response object.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A whisker-thin change, but oh how it gleams,
From parameter to response—refining the dreams,
One line swapped with care, the message now flows,
Where the true answer lives, the notification knows! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the bug being fixed and the component affected, directly matching the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description is comprehensive and well-structured, explaining the problem, root cause, and fix clearly with an adequate test plan.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/admin-rebuild-toast-render-error

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.

Tip

Migrating from UI to YAML configuration.

Use the @coderabbitai configuration command in a PR comment to get a dump of all your UI settings in YAML format. You can then edit this YAML file and upload it to the root of your repository to configure CodeRabbit programmatically.

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 087fa15):

https://game-ci-5559f--pr545-fix-admin-rebuild-to-xric3irz.web.app

(expires Fri, 27 Mar 2026 16:41:14 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1f0574f15f83e11bfc148eae8646486a6d0e078b

@frostebite
Copy link
Member Author

Confirmed tested

@frostebite frostebite enabled auto-merge (squash) March 20, 2026 16:55
@frostebite frostebite requested a review from webbertakken March 20, 2026 19:29
@frostebite frostebite merged commit 71d7118 into main Mar 20, 2026
10 checks passed
@frostebite frostebite deleted the fix/admin-rebuild-toast-render-error branch March 20, 2026 21:31
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