Skip to content

fix: Fix ClientAuthSessionManager not catching network errors on init - #4072

Merged
marcelomendoncasoares merged 7 commits into
serverpod:mainfrom
marcelomendoncasoares:fix-network-error-on-client
Nov 6, 2025
Merged

marcelomendoncasoares merged 7 commits into
serverpod:mainfrom
marcelomendoncasoares:fix-network-error-on-client

Conversation

@marcelomendoncasoares

@marcelomendoncasoares marcelomendoncasoares commented Oct 17, 2025 •

Copy link
Copy Markdown
Collaborator

Fix network errors not being caught on ClientAuthSessionManager initialization.

While making this fix, it was also identified that there were an asymmetry between web and platform clients: web was replacing network exception (http.ClientException) by ServerpodClientException, while platform wasn't. This PR also fixes this asymmetry by making platform also replace the exception. Although the solution of using ServerpodClientException with code -1 is not ideal, it is best to have both exceptions paired and further improve exception handling when working on issue #3283.

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

If you need help, consider asking for advice on the discussion board.

Breaking changes

None.

@coderabbitai

coderabbitai Bot commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@SandPod SandPod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! 👍

Please update the PR description so that it reflects the bug that is fixed (helps out when writing the changelogs).

@marcelomendoncasoares
marcelomendoncasoares merged commit 49830e6 into serverpod:main Nov 6, 2025
@marcelomendoncasoares
marcelomendoncasoares deleted the fix-network-error-on-client branch November 6, 2025 04:23
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants