Skip to content

fix(upload): apply --tag and --session-tag to replacement uploads too - #1424

Open
gthb wants to merge 4 commits into
simulot:mainfrom
gthb:fix/tags-on-replacement-uploads
Open

gthb wants to merge 4 commits into
simulot:mainfrom
gthb:fix/tags-on-replacement-uploads

Conversation

@gthb

@gthb gthb commented Aug 18, 2026

Copy link
Copy Markdown

What

Fix --tag and --session-tag not being applied to replacement uploads (a bigger copy replacing a smaller server copy, reported as "server asset upgraded", or an --overwrite replacement); only assets uploaded as new got those tags.

Cause

uploadAsset adds the command-line tags to the asset before uploading; the upload itself does not send tags, processUploadedAsset applies them afterwards. replaceAsset uploads without adding them, so processUploadedAsset has nothing to apply.

Fix

Add the command-line tags in processUploadedAsset (the one place tags are applied) instead of in each upload path, so no upload path can forget them.

Test_Replace now passes --tag=replaced for the replacement run and expects the upgraded assets to be tagged; it fails without the fix.

Notes

Based on main rather than develop, because it was tested against Immich v3, whose support is on main only.

gthb added 3 commits August 18, 2026 17:48
uploadAsset adds the command-line tags to the asset before uploading;
replaceAsset (a bigger version of a server asset, or --overwrite) called
AssetUpload directly, so the replacement asset never got them. Factor
the tagging into addCommandLineTags and call it from both.
Test_Replace runs the second upload with --tag and expects the five
upgraded assets to be tagged; without the addCommandLineTags call in
replaceAsset it reports 0.
--session-tag is a boolean flag; the tag added is the session name. Also
note that the tags are applied on the server by processUploadedAsset,
not by the upload itself.
@gthb
gthb requested a review from simulot as a code owner August 18, 2026 18:19
Instead of each upload path (uploadAsset, replaceAsset) adding the
command-line tags to the asset before uploading, add them once in
processUploadedAsset, immediately before manageAssetTags — the single
place where an asset's tags are applied on the server. This removes the
duty of every upload path to remember the command-line tags, so a future
upload path cannot forget them.
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