Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete empty files left in cache directory #591

Merged
merged 9 commits into from
Sep 25, 2019
Merged

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Sep 10, 2019

Goal

API 26 added a cacheBehaviorTombstone API, which leaves behind a zero-length file rather than
deleting the file entirely. We should delete any empty files when attempting to send cached
errors/sessions.

Changeset

Check for the presence of an empty file and delete it within findStoredFiles().

Tests

Manually verified in a local artefact that if an empty file is added to the bugsnag-errors directory it is discarded.

API 26 added a cacheBehaviorTombstone API, which leaves behind a zero-length file rather than
deleting the file entirely. We should delete these files when attempting to send cached
errors/sessions.
Copy link
Contributor

@kattrali kattrali left a comment

Choose a reason for hiding this comment

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

Seems like a straightforward change, though it needs an automated test to verify that an empty file is deleted if present in a tombstoned directory. Added other questions inline.

CHANGELOG.md Outdated Show resolved Hide resolved
@fractalwrench
Copy link
Contributor Author

I've now added a mazerunner scenario to verify that cached tombstone files are deleted.

@fractalwrench fractalwrench changed the title Delete tombstoned files left in cache directory Delete empty files left in cache directory Sep 25, 2019
@fractalwrench fractalwrench changed the base branch from next to master September 25, 2019 10:34
@fractalwrench fractalwrench changed the base branch from master to next September 25, 2019 10:34
@fractalwrench fractalwrench merged commit 53a6d80 into next Sep 25, 2019
@fractalwrench fractalwrench deleted the delete-tombstones branch September 25, 2019 10:46
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.

None yet

3 participants