Skip to content

Fix deletion of records and subjects with uploaded files - #1605

Merged
joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
MiroslavGit:fix/1572-delete-record-files
Oct 4, 2026
Merged

joshunrau merged 1 commit into
DouglasNeuroInformatics:mainfrom
MiroslavGit:fix/1572-delete-record-files

Conversation

@MiroslavGit

Copy link
Copy Markdown

Closes #1572.

Summary

  • authorize deletion before reading dependent file metadata
  • delete InstrumentRecordFile rows before deleting records in the same database transaction
  • delete physical storage objects only after the database transaction commits
  • log storage cleanup failures so orphaned objects can be recovered manually
  • support both individual record deletion and force-deleting subjects with uploaded files
  • add storage, service, API integration, and Playwright regression tests

Validation

  • targeted API unit tests: 81 passed
  • API test suite: 488 passed
  • Playwright E2E for record file deletion: 7 passed
  • manually verified with local MongoDB and RustFS:
    • deleting a record with an uploaded file returns 204
    • force-deleting a subject with uploaded files returns 200
    • related database rows are removed
    • corresponding storage objects are removed

@joshunrau joshunrau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

awesome! looks great, thanks a lot!

@joshunrau
joshunrau merged commit 33dba20 into DouglasNeuroInformatics:main Oct 4, 2026
2 checks passed
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.

Deleting a record that has uploaded files, or force-deleting its subject, is refused

2 participants