-
Notifications
You must be signed in to change notification settings - Fork 289
Fix error toast display for profile settings save #5345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: omBratteng <1681525+omBratteng@users.noreply.github.com>
|
|
|
@copilot Rebase your changes, I added the loading button in a separate PR. |
Wrap JSON.parse in try-catch to prevent crashes when error messages are not in the expected JSON format. Toast notification will still be displayed even if parsing fails.
Rebased and removed duplicate loading button change. Added try-catch wrapper around JSON.parse to ensure error toast displays correctly even when error response format is unexpected. (fe63197) |
Log parsing errors to console to aid debugging when error responses don't match expected JSON format. Co-authored-by: omBratteng <1681525+omBratteng@users.noreply.github.com>
Move displayToast call outside if statement since the same message is shown in all error cases. Also improve logging to include the original error message for better debugging. Co-authored-by: omBratteng <1681525+omBratteng@users.noreply.github.com>
Co-authored-by: omBratteng <1681525+omBratteng@users.noreply.github.com>
- Type catch variable as 'unknown' for better type safety - Only log parsing errors in non-production environments Co-authored-by: omBratteng <1681525+omBratteng@users.noreply.github.com>
Changes
Profile settings UpdateUserInfo mutation was missing proper error handling to display toast notifications consistently.
Technical changes
packages/shared/src/hooks/useUserInfoForm.tsNote: Loading button functionality was added in a separate PR (#5349) and is not part of this change.
Events
No new tracking events.
Experiment
No new experiments.
Manual Testing
Caution
Please make sure existing components are not breaking/affected by this PR
On those affected packages:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Preview domain
https://copilot-fix-update-user-info-err.preview.app.daily.dev