don't re-set changes for refreshed outputs

When output values are updated in the refreshed state, we don't need to
re-set the changes which were already set in conjunction with the
current state.
This commit is contained in:
James Bardin 2022-11-21 11:04:21 -05:00
parent ec6451a82a
commit c9d6f82ac5

View File

@ -400,7 +400,8 @@ If you do intend to export this data, annotate the output value as sensitive by
// If we were able to evaluate a new value, we can update that in the
// refreshed state as well.
if state = ctx.RefreshState(); state != nil && val.IsWhollyKnown() {
n.setValue(state, changes, val)
// we only need to update the state, do not pass in the changes again
n.setValue(state, nil, val)
}
return diags