Conversation
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix upload errors inside a group (burst, RAW+JPEG, edited pair) not counting towards
--on-errorswhen the group's last asset uploads fine: with the default--on-errors=stopthe run carried on instead of stopping, and with--on-errors=Nthose errors did not count towards N. They were still logged and listed in the final report.Cause
handleGroupjoined 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, andnilwhen the last asset succeeded.Fix
errors.Join(errGroup, err).Notes
Based on
mainrather thandevelop; 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.