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

.freeze() still allows modifications, from e.g. .mergeFromProto3Json() #489

Closed
azurvii opened this issue Mar 16, 2021 · 0 comments · Fixed by #727
Closed

.freeze() still allows modifications, from e.g. .mergeFromProto3Json() #489

azurvii opened this issue Mar 16, 2021 · 0 comments · Fixed by #727
Assignees
Labels

Comments

@azurvii
Copy link

azurvii commented Mar 16, 2021

For example, the following code would not trigger a runtime exception:

MyMessage.create()
    ..mergeFromProto3Json(json.decode('{"id":888}'))
    ..freeze()
    ..mergeFromProto3Json(json.decode('{"id":999}'));

Or:

MyMessage.getDefault()
    ..mergeFromProto3Json(json.decode('{"id":999}'));

The second would change the singleton default instance, which, according to the code generated for me, is a frozen object.

My setup:

$ flutter --version
Flutter 2.0.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 8962f6dc68 (5 days ago) • 2021-03-11 13:22:20 -0800
Engine • revision 5d8bf811b3
Tools • Dart 2.12.1
$ protoc --version
libprotoc 3.15.6
$ flutter pub global list
protoc_plugin 20.0.0
@azurvii azurvii changed the title .freeze() still allows .mergeFromProto3Json() modifications .freeze() still allows modifications, from e.g. .mergeFromProto3Json() Mar 17, 2021
@osa1 osa1 added the bug label Apr 13, 2022
@osa1 osa1 self-assigned this Apr 13, 2022
osa1 added a commit to osa1/protobuf.dart that referenced this issue Aug 9, 2022
osa1 added a commit to osa1/protobuf.dart that referenced this issue Aug 9, 2022
@osa1 osa1 closed this as completed in #727 Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants