Ssi 1253 hr objects are not valid as a react child found object error - #580
Open
sam-drumm wants to merge 3 commits into
Open
Conversation
chore: merge dev with main
sam-drumm
commented
Sep 4, 2026
| > | ||
| {({ | ||
| isSubmitting, | ||
| // , errors, isValid |
Contributor
Author
There was a problem hiding this comment.
these were never used anyway so cleaned
|
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.



Summary
Fixes Sentry error on the staff assessment tab after a failed PATCH. Also closes the same crash on other save paths that catch a failure and put it in the error banner.
The Sentry event fired when staff changed band / bidding number → PATCH 400 (reserved or duplicate bidding number) → white screen. The assessment form stored the caught
Errorobject in state and rendered it in the error summary. React cannot render an object as a child, so it throws React error as reported.Fixes
Assessment tab
submitErrorinstead of theErrorobject (this is the crash).updateApplicationnow uses the API message when present (e.g. reserved bidding number), otherwiseUnable to update application (${status}).router.replace()instead ofrouter.reload(), so the browser cannot restore old radio values over the fresh page (PATCH 200, then values revert on reload noticed in testing).onSubmitreturns the promise so Formik clearsisSubmitting.enableReinitializepicks up server-assigned bidding numbers after the refetch.ConsistentReadon the API (PR) so the refetch returns the updated record.User-facing errors vs technical errors
toUserErrorMessagealways returns a string, so React is never handed anErroras a child.rejectWithValuestrings (e.g.Unable to create verify code (500)) andUserFacingErrorfrom the housing API (e.g. reserved bidding number).console.error'd so it still reaches Sentry via the console integration ininstrumentation-client.ts.Resident apply
Sign-in, verify, and declaration catch a failed request and put the result in the error banner. That is fine when the failure is already a string. It is not fine when it is an
Error(network drop, invalid JSON). Those pages now go throughtoUserErrorMessage. HTTP errors still display the same copy as before.Health tab (medical details)
PATCH 400 then unhandled rejection. Staff could send an empty form-received date, which the API rejects. The field is now required, the PATCH is awaited, failures show in an error summary and do not reload.
Other staff actions
res.ok, throw, return the Formik promise, show error, do not reload on failure.Failed to fetch.Test plan
Failed to fetch.