Skip to content

Don't pre-create stateChanges to avoid empty structures for no-op changes#506

Merged
Shaptic merged 4 commits intomainfrom
omit-empty-stateChanges
Aug 29, 2025
Merged

Don't pre-create stateChanges to avoid empty structures for no-op changes#506
Shaptic merged 4 commits intomainfrom
omit-empty-stateChanges

Conversation

@Shaptic
Copy link
Contributor

@Shaptic Shaptic commented Aug 28, 2025

What

As part of #396 we allowed pre and post to both be nil, but did not handle their JSON-side rendering. Since we preallocated the stateChanges list, it would have empty structures in those cases despite the continue. By using append, we ensure only meaningful structures get rendered.

Why

We should conform to our API contract and never have type = "".

Known limitations

n/a

@Shaptic Shaptic changed the title Don't pre-create stateChanges: it results in empty structures for no-op changes Don't pre-create stateChanges to avoid empty structures for no-op changes Aug 28, 2025
@Shaptic Shaptic enabled auto-merge (squash) August 29, 2025 19:35
@Shaptic Shaptic merged commit ee83018 into main Aug 29, 2025
16 of 17 checks passed
@Shaptic Shaptic deleted the omit-empty-stateChanges branch August 29, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants