Skip to content
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

fix: server action error handling #3659

Merged
merged 11 commits into from
May 16, 2024
Merged

Conversation

bryan-robitaille
Copy link
Contributor

@bryan-robitaille bryan-robitaille commented May 16, 2024

Summary | Résumé

fixes: #3580

Ensures that server actions called by client components have handled errors so that the thrown error does not traverse the server/client boundary. New behavior is to send the error back as an object to the client component where it can be thrown or handled.

Also adds the language to some links that were missing it. This helps reduce the number of rewrites the middleware must make when receiving a request that has the missing language parameter.

Found and deleted unused auth code useResetPassword.

Unresolved questions / Out of scope | Questions non résolues ou hors sujet

Out of scope is the error handling of the failed server actions client side.

Pull Request Checklist

Please complete the following items in the checklist before you request a review:

  • Have you completely tested the functionality of change introduced in this PR? Is the PR solving the problem it's meant to solve within the scope of the related issue?
  • The PR does not introduce any new issues such as failed tests, console warnings or new bugs.
  • If this PR adds a package have you ensured its licensed correctly and does not add additional security issues?
  • Is the code clean, readable and maintainable? Is it easy to understand and comprehend.
  • Does your code have adequate comprehensible comments? Do new functions have docstrings?
  • Have you modified the change log and updated any relevant documentation?
  • Is there adequate test coverage? Both unit tests and end-to-end tests where applicable?
  • If your PR is touching any UI is it accessible? Have you tested it with a screen reader? Have you tested it with automated testing tools such as axe?

Copy link
Contributor

Copy link
Contributor

@craigzour craigzour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

Copy link
Contributor

@thiessenp-cds thiessenp-cds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally tested throwing errors. Works as expected. Nice, LGTM :)

For example, error thrown:
Screenshot 2024-05-16 at 12 51 59 PM

Error handled:
Screenshot 2024-05-16 at 12 53 00 PM

@bryan-robitaille bryan-robitaille merged commit 0d5295a into develop May 16, 2024
13 checks passed
@bryan-robitaille bryan-robitaille deleted the fix/action_error_handling branch May 16, 2024 16:57
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.

Action Errors showing up in server logs
3 participants