bug(import): skipped file list is lost when import transitions to FAILED state #621

Open
opened 2026-05-18 15:21:06 +02:00 by marcel · 0 comments
Owner

Problem

When an import fails mid-run (e.g. spreadsheet not found, or an uncaught exception), currentStatus is reset with an empty skippedFiles list:

currentStatus = new ImportStatus(State.FAILED, "IMPORT_FAILED_INTERNAL",
        "Fehler: " + e.getMessage(), 0, List.of(), currentStatus.startedAt());

Any files that were skipped (invalid PDF signature, read error) before the failure occurred are irretrievably discarded. The admin card only surfaces skippedFiles in the DONE state, so even if we preserved the list it would need a frontend change to show it on failure.

Expected behaviour

If 3 files were skipped before an internal error aborted the import, the admin should still be able to see those 3 skipped files in the status card — either in the FAILED state display, or in a persistent log.

Acceptance criteria

  • Given an import that skips 2 files then fails on a third, when the admin checks import status, then skippedFiles contains the 2 already-skipped entries
  • The frontend ImportStatusCard shows the skipped section for FAILED state when skipped > 0
  • Regression tests cover the partial-skip-then-fail scenario

Notes

The simplest backend fix is to pass the in-progress skippedFiles list through to the FAILED status constructors rather than List.of(). The frontend change is a one-line {#if} condition addition.

Surfaced during review of #618.

## Problem When an import fails mid-run (e.g. spreadsheet not found, or an uncaught exception), `currentStatus` is reset with an empty `skippedFiles` list: ```java currentStatus = new ImportStatus(State.FAILED, "IMPORT_FAILED_INTERNAL", "Fehler: " + e.getMessage(), 0, List.of(), currentStatus.startedAt()); ``` Any files that were skipped (invalid PDF signature, read error) before the failure occurred are irretrievably discarded. The admin card only surfaces `skippedFiles` in the `DONE` state, so even if we preserved the list it would need a frontend change to show it on failure. ## Expected behaviour If 3 files were skipped before an internal error aborted the import, the admin should still be able to see those 3 skipped files in the status card — either in the FAILED state display, or in a persistent log. ## Acceptance criteria - Given an import that skips 2 files then fails on a third, when the admin checks import status, then `skippedFiles` contains the 2 already-skipped entries - The frontend `ImportStatusCard` shows the skipped section for `FAILED` state when `skipped > 0` - Regression tests cover the partial-skip-then-fail scenario ## Notes The simplest backend fix is to pass the in-progress `skippedFiles` list through to the FAILED status constructors rather than `List.of()`. The frontend change is a one-line `{#if}` condition addition. Surfaced during review of #618.
marcel added the P2-mediumbug labels 2026-05-18 15:21:12 +02:00
Sign in to join this conversation.
No Label P2-medium bug
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#621