Skip to content

fix: record failed uploads and deletes in the audit log - #15

Merged
blaipr merged 1 commit into
mainfrom
fix/audit-failed-file-writes
Sep 2, 2026
Merged

blaipr merged 1 commit into
mainfrom
fix/audit-failed-file-writes

Conversation

@blaipr

@blaipr blaipr commented Sep 2, 2026

Copy link
Copy Markdown
Member

What this changes

files_upload, files_delete, files:upload and files:delete record a failed audit entry, carrying the path and the error, when the FTP operation throws — the same shape db_execute / db:execute already use. docs/safety.md documents the three outcomes.

Why

A failed upload or delete left no trace in the log at all. An upload that broke off may have left a partial file on the site, and a log listing only the writes that succeeded cannot explain a truncated file when someone asks what happened. The error is still rethrown, so the caller sees the same failure as before.

Checklist

  • npm test passes
  • npm run typecheck passes
  • Documentation in docs/ updated if behaviour changed
  • CHANGELOG.md updated if the change is user-observable
  • No credentials, hostnames or database names in the diff

@blaipr
blaipr force-pushed the fix/audit-failed-file-writes branch from c1f0ee3 to d16b5b8 Compare September 2, 2026 22:08
@blaipr
blaipr merged commit f58cd6e into main Sep 2, 2026
@blaipr
blaipr deleted the fix/audit-failed-file-writes branch September 2, 2026 22:08
@blaipr blaipr mentioned this pull request Sep 2, 2026
5 tasks
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.

1 participant