Prevent curve overwrite during GridLine deserialization#1101
Prevent curve overwrite during GridLine deserialization#1101katehryhorenko merged 4 commits intomasterfrom
Conversation
wynged
left a comment
There was a problem hiding this comment.
Reviewable status: 1 change requests, 0 of 1 approvals obtained
Elements/src/GridLine.cs line 33 at r1 (raw file):
// TODO: Remove this constructor once we remove the Line and Geometry properties. [JsonConstructor] private GridLine(BoundedCurve curve, Polyline geometry, Line line)
I'm surprised we don't need to call the geometric element constructor from this line as welll, I think most of our other custom constructors call their inherited constructor. Will the other properties get set correctly still?
katehryhorenko
left a comment
There was a problem hiding this comment.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @wynged)
Elements/src/GridLine.cs line 33 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
I'm surprised we don't need to call the geometric element constructor from this line as welll, I think most of our other custom constructors call their inherited constructor. Will the other properties get set correctly still?
It's a good point. I pushed the change
wynged
left a comment
There was a problem hiding this comment.
Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status:complete! 1 of 1 approvals obtained
🌌 BACKGROUND:
GridLinehas three properties that can set its geometry:Curve,Geometry, andLine.In some workflows (e.g., created by a function and later edited in Pringle), a
GridLinecan enter a corrupt state where:Curvecontains the correct value,LineorGeometryvalues,📋 DESCRIPTION:
This PR prevents unwanted overwriting of the
Curveduring deserialization:Introduces a
deserializationIsInProgressflag:trueinside theJsonConstructor.falsein theOnDeserializedcallback.Modifies the
LineandGeometrysetters to skip assigning toCurveduring deserialization, preserving the originalCurveif it's already set.🧪 TESTING:
suggest-everywhereflag.This change is