Skip to content

fix: Restrict fields with scopes other than all to be nullable. - #1815

Merged
Isakdl merged 2 commits into
serverpod:mainfrom
Isakdl:scopeLimitation
Jan 24, 2024
Merged

Isakdl merged 2 commits into
serverpod:mainfrom
Isakdl:scopeLimitation

Conversation

@Isakdl

@Isakdl Isakdl commented Jan 24, 2024

Copy link
Copy Markdown
Collaborator

Fix

  • A bug that allowed fields with scope serverOnly or none to be nullable, which would crash at run time when trying to deserialize a client instance into a server instance of the class.

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

It was previously possible to set this condition but it would have the potential to crash at runtime.

@Isakdl
Isakdl requested a review from SandPod January 24, 2024 15:01

@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! Nice catch 🥅

@Isakdl
Isakdl merged commit e0d81a6 into serverpod:main Jan 24, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 24, 2024
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