plan renderer: fix crash when updating a null attribute to unknown#35709
plan renderer: fix crash when updating a null attribute to unknown#35709liamcervante merged 1 commit intomainfrom
Conversation
|
Is this the right base branch? |
Yeah, this PR has a dependency on #35644 as I wanted to make the other fix work in a certain way that this crash was preventing. But the root cause of the two issues are different, and I thought it was nicer to fix them in dedicated PRs for accounting purposes. |
|
Aha, I didn't see that one, thanks! |
4a21033 to
cf16330
Compare
|
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This PR fixes a crash in the plan renderer that occurs when a plan marks an attribute that was null as becoming unknown.
The renderer had assumed that all computed attributes would have a value if the resource was being updated, so was only checking for
plans.Createactions before deciding whether to render the "before" part of an unknown change. Now, we explicitly check whether the before part has a renderer at all when deciding whether to render the before part rather than simply relying on a logical consistency based on the false assumption it would only ever be create actions doing this.There's also a flyby fix of the block renderers which can now successfully render blocks becoming unknown as update actions instead of create since that does not crash anymore.
Note, we could render this as something like
~ attr = null -> (known after apply), instead of just~ attr = (known after apply), but I don't think we do that elsewhere (like when an optional attribute is set during an update operation) so I didn't implement it here but it would be trivial to do.Fixes #35630
Target Release
v1.9.7
Draft CHANGELOG entry
BUG FIXES