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

RDART-960 Fix generated _fromEJson on Realm models #1543

Merged
merged 7 commits into from
Mar 7, 2024

Conversation

nielsenko
Copy link
Contributor

@nielsenko nielsenko commented Mar 7, 2024

Fixes: #1542

Includes a few unrelated fixes to tool/build.dart and for non-const initializers (not allowed on realm models, as the initializer is used to initialize ctor parameters )

  • Fix bug wrt. argument to Process.start
  • Remove redundant argument. Handled by cmake preset
  • Fix issue with ejson serialization skipping collections
  • Fix good tests
  • Add extra error test for const initializers
  • Update realm_dart after realm_generator fix

This is done by restoring sanity to allSettable,
required, and nonRequired fields.

This also fixes an unnecessary reordering of nonRequired
fields, where collections was always at the back, and
ordered list, set, then map.

This commit also fixes a blemish regarding initializers.
Since field initializers become ctor parameter initializers
they need to be constant. For now we only allow literals.
@cla-bot cla-bot bot added the cla: yes label Mar 7, 2024
@nielsenko nielsenko requested a review from nirinchev March 7, 2024 11:06
@nielsenko nielsenko marked this pull request as ready for review March 7, 2024 11:08
@nielsenko nielsenko added the no-changelog Used to skip the changelog check label Mar 7, 2024
Copy link

Pull Request Test Coverage Report for Build 8188543018

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 22 of 22 (100.0%) changed or added relevant lines in 3 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.06%) to 86.503%

Files with Coverage Reduction New Missed Lines %
packages/realm_generator/lib/src/realm_model_info.dart 1 98.41%
packages/realm_generator/lib/src/realm_field_info.dart 3 92.68%
Totals Coverage Status
Change from base Build 8175347797: -0.06%
Covered Lines: 5736
Relevant Lines: 6631

💛 - Coveralls

@nielsenko nielsenko merged commit 8714f74 into main Mar 7, 2024
56 checks passed
@nielsenko nielsenko deleted the kn/ejson-follow-up branch March 7, 2024 13:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes no-changelog Used to skip the changelog check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The EJson codecs generated by realm_generator don't handle collections
2 participants