Skip to content

Fix stale volume file on overwrite - #497

Open
HussainAther wants to merge 1 commit into
OpenwaterHealth:mainfrom
HussainAther:fix/issue-136-volume-overwrite-cleanup
Open

Fix stale volume file on overwrite#497
HussainAther wants to merge 1 commit into
OpenwaterHealth:mainfrom
HussainAther:fix/issue-136-volume-overwrite-cleanup

Conversation

@HussainAther

Copy link
Copy Markdown

Fixes #136.

When Database.write_volume() overwrites an existing volume using a different
source filename, the previously associated volume data file remains in the
database directory.

This change records the existing volume data file before overwrite and removes
it after the replacement file has been copied successfully.

Validation:

  • pytest tests/test_database.py -k issue_136 -v
  • 1 passed, 56 deselected

@ebrahimebrahim

Copy link
Copy Markdown
Collaborator

This looks good on first glance; planning to do a proper review and integrate this in a couple of weeks if no one gets to it before me. Thank you!

@ebrahimebrahim
ebrahimebrahim force-pushed the fix/issue-136-volume-overwrite-cleanup branch from cd77c54 to 75284c5 Compare August 28, 2026 16:15
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.

Overwriting a volume can leave a dangling volume file in the database

2 participants