Skip to content

File can be removed physically from storage without db update #756

Open
@Koc

Description

@Koc

I've found interesting edge case: create form with vich file type (allow delete = true), then check remove file and submit invalid form. Post submit listener removes file from disk and clean file information from entity. But usually nobody calls flush for invalid forms. So we got unsynchronized state: file was removed but database not updated.

I see 2 different approaches to fixing this issue:

  • a. change priority of our removing listener and check for isValid first (easy but not cover all cases)
  • b. add dynamic preflush listener to entity manager wich will remove file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions