Skip to content

fix(upload): keep every asset's error when uploading a group - #1428

Open
gthb wants to merge 2 commits into
simulot:mainfrom
gthb:fix/handle-group-error-join
Open

gthb wants to merge 2 commits into
simulot:mainfrom
gthb:fix/handle-group-error-join

Conversation

@gthb

@gthb gthb commented Aug 19, 2026

Copy link
Copy Markdown

What

Fix upload errors inside a group (burst, RAW+JPEG, edited pair) not counting towards --on-errors when the group's last asset uploads fine: with the default --on-errors=stop the run carried on instead of stopping, and with --on-errors=N those errors did not count towards N. They were still logged and listed in the final report.

Cause

handleGroup joined each asset's error with nothing (errGroup = errors.Join(err)) instead of with the errors collected so far, so it returned only the last asset's error, and nil when the last asset succeeded.

Fix

errors.Join(errGroup, err).

Notes

Based on main rather than develop; the changed line is the same on both branches. It sits next to a line that #1423 changes, so whichever of the two merges second needs a trivial rebase.

handleGroup joined each asset's error with nothing instead of with the
errors collected so far, so it returned only the last asset's error. When
the last asset of a group uploaded fine, earlier failures in the group
were dropped: they didn't count towards --on-errors, and with the default
--on-errors=stop the run carried on as if nothing had happened.
@gthb
gthb requested a review from simulot as a code owner August 19, 2026 11:35
Regression test for the errors.Join fix: a group where the first asset
fails and the last succeeds must still yield a non-nil error from
handleGroup. Uses the AlreadyProcessed path for the succeeding asset and
GroupByNone grouping so no Immich client is needed. Fails against the
pre-fix code (which returned nil), passes with the fix.

This branch has not been deployed

No deployments
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