Skip to content

FOLLOW-UP: Log file deletion errors in ConfirmDelete handler #272

@adnaan

Description

@adnaan

Context

This follow-up task was identified during the review of PR #267.

Source PR: #267
PR Title: feat: add file upload & storage support (Roadmap 2.2)
Suggested by: @claude[bot]

Task Description

The generated ConfirmDelete handler ignores Store.Delete errors with _ = c.Store.Delete(...). While this is reasonable (the DB row is deleted regardless), a log.Printf would help operators detect orphaned files in storage.

Change in handler.go.tmpl:

// Current:
_ = c.Store.Delete(dbCtx, existing.Photo)

// Proposed:
if err := c.Store.Delete(dbCtx, existing.Photo); err != nil {
    log.Printf("warning: failed to delete file from storage: %v", err)
}

Same change needed in the Update handler's old-file cleanup path.


This issue was automatically created by prmonitor from PR review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upFollow-up task from PR reviewfrom-reviewIssue originated from PR review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions