Skip to content

Fix deletion of file content on snapshot error#7898

Merged
dominikschubert merged 1 commit intomasterfrom
fix_snapshot-empty-file
Mar 17, 2023
Merged

Fix deletion of file content on snapshot error#7898
dominikschubert merged 1 commit intomasterfrom
fix_snapshot-empty-file

Conversation

@dominikschubert
Copy link
Member

When updating or creating new snapshots, an error when serializing the new snapshot previously lead to the complete removal of the file's content.

By moving truncate to after the JSON serialization, an error here will now simply leave the old state as it was instead of leaving behind an empty file.

@dominikschubert dominikschubert self-assigned this Mar 17, 2023
@dominikschubert dominikschubert temporarily deployed to localstack-ext-tests March 17, 2023 16:02 — with GitHub Actions Inactive
Copy link
Member

@steffyP steffyP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great change 😄 🙌 This was bothering us for a while, thanks for tackling this issue! 🙏 🚀

@coveralls
Copy link

Coverage Status

Coverage: 85.105% (-0.02%) from 85.122% when pulling 74c44e1 on fix_snapshot-empty-file into 92dca7d on master.

@dominikschubert dominikschubert merged commit f771a97 into master Mar 17, 2023
@dominikschubert dominikschubert deleted the fix_snapshot-empty-file branch March 17, 2023 16:50
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.

3 participants