fix: surface errors on moderation actions instead of silently closing dialog - #192
Open
sandeep-2536 wants to merge 1 commit into
Open
Conversation
… dialog Previously doAction swallowed API errors silently, so a failed warn/suspend/ban still closed the modal, making admins believe the action succeeded when it hadn't.
sandeep-2536
force-pushed
the
fix/admin-moderation-silent-failure
branch
from
July 29, 2026 13:51
7e3824d to
d82a079
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
doActioninAdminModeration.tsxsilently caught and discarded API errors.When a warn/suspend/ban request failed, the modal still closed as if it had
succeeded — so an admin had no way to know the action didn't actually happen.
Fix
so the admin can retry, and the entered reason text is preserved
AdminModeration.test.tsxcovering both the failure path (modal staysopen, error shown) and the success path (modal closes, fields reset)
How this was found
Found via manual code review of the admin moderation flow, not from an
assigned GitHub issue.
Testing
DevTools — confirmed error is shown and modal stays open
pnpm exec tsc --noEmitpassespnpm test— newAdminModeration.test.tsxtests pass. Note: 3 unrelatedtest suites (
api.test.ts,PremiumTee.test.ts,GoldenTicketDetailPage.test.tsx)fail on
mainas well, due to a pre-existing tooling error(
jsTokens is not a function) unrelated to this change.