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

Prevent mutating operations on a realm with frozen arguments #942

Merged
merged 9 commits into from
Oct 18, 2022

Conversation

nirinchev
Copy link
Member

No changelog entry because we haven't shipped frozen objects yet.

This is guarding against mutating a live realm when passing frozen arguments.

@nirinchev nirinchev self-assigned this Oct 5, 2022
@cla-bot cla-bot bot added the cla: yes label Oct 5, 2022
Copy link
Contributor

@nielsenko nielsenko left a comment

Choose a reason for hiding this comment

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

LGTM

@coveralls
Copy link

coveralls commented Oct 5, 2022

Pull Request Test Coverage Report for Build 3272812341

  • 15 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+4.1%) to 92.558%

Totals Coverage Status
Change from base Build 3272687972: 4.1%
Covered Lines: 398
Relevant Lines: 430

💛 - Coveralls

lib/src/realm_class.dart Outdated Show resolved Hide resolved
lib/src/realm_class.dart Show resolved Hide resolved
@blagoev
Copy link
Contributor

blagoev commented Oct 10, 2022

For the record. When freezing an object it's realm becomes a new different Realm instance. Hence the realm equals check.

@nirinchev nirinchev requested a review from blagoev October 10, 2022 10:45
Copy link
Contributor

@desistefanova desistefanova left a comment

Choose a reason for hiding this comment

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

Looks great. I've added some questions and ideas to discuss.

test/realm_test.dart Outdated Show resolved Hide resolved
test/realm_test.dart Show resolved Hide resolved
lib/src/realm_class.dart Outdated Show resolved Hide resolved
Copy link
Contributor

@desistefanova desistefanova left a comment

Choose a reason for hiding this comment

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

Since we released today, maybe a Changelog entry will be needed.

Copy link
Contributor

@desistefanova desistefanova left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you!

@nirinchev nirinchev merged commit 05591dd into master Oct 18, 2022
@nirinchev nirinchev deleted the ni/prevent-frozen-modifications-in-another-realm branch October 18, 2022 11:52
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants