Skip to content

Recover in-progress submissions when the FileAggregate is missing #810

Description

@StuartFerguson

Summary

Add recovery support for files left in the inprogress directory when the corresponding FileAggregate stream was never created.

Proposed behaviour

During startup recovery:

  • Parse the estate ID and file ID from the in-progress filename.
  • Retry through the existing FileAggregate path when the aggregate exists.
  • If the aggregate is missing, find the file by file ID in the import-log read model.
  • Use the recovered merchant, user, import-log, profile, and upload timestamp metadata to submit the file as an initial ProcessUploadedFile operation.
  • Use the file ID from the filename so the FileAggregate can be created and processing can continue.

Acceptance criteria

  • Existing aggregate-backed retries continue to work.
  • An in-progress file with no FileAggregate can be submitted and processed.
  • The recovered submission preserves the original upload metadata.
  • Recovery is covered by automated tests.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions