You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
imogen album create "" makes an album no name can reach #43
AlbumCommand::Create passes the name to the API as it stands, so an empty or
whitespace-only one is accepted and stored. The album that results is reachable only by id: find_album refuses an empty reference (#38), and no non-empty reference matches an empty
name, so imogen album show, add, remove, delete and --album can never name it
again. album update --name "" does the same to an album that had a usable name.
imogen upload --album "$ALBUM" with the variable unset is now refused, which is #38 —
this is the other half, where the unusable name is written rather than read.
Reproduction
imogen album create "" # or --name " "
imogen album list # a row with an empty NAME
imogen album show "" # refused: an empty reference cannot pick one
Expected
An album name is trimmed and cannot be empty, on create and on update --name: refuse
with a message saying so, before anything reaches the wire, the way an empty reference is
refused when reading.
The lookup side already trims the stored name when comparing (see named_album in src/context.rs), so a padded name is at least still findable; an empty one cannot be.
Affected repos
Only imogen-cli — the server accepts what it is sent, and nothing on the wire changes.
Whether the server should also refuse an empty album name is a separate question for imogen-server.
Context
Found by review on the #38 PR (#42), which hardens reading a reference
that cannot pick an album and leaves writing one untouched.
Fixed in 9460959 (#44). context::album_name trims an album name and refuses an empty one, on album create and on album update --name, before anything reaches the wire — the mirror of the guard albums_for puts on reading a reference. It trims as well as refuses because named_album compares the stored name trimmed, so creation and lookup now settle on the same string; album_or_create already created under the trimmed name. On update the refusal runs before find_album, so nothing at all is sent. Four tests in commands/albums.rs cover both doors and both the empty and the padded name; the two refusal tests assert the stub recorded no calls.
Whether the server should also refuse an empty album name is still open and belongs in imogen-server.
Activity
ergofobe commentedon Sep 16, 2026
Fixed in 9460959 (#44).
context::album_nametrims an album name and refuses an empty one, onalbum createand onalbum update --name, before anything reaches the wire — the mirror of the guardalbums_forputs on reading a reference. It trims as well as refuses becausenamed_albumcompares the stored name trimmed, so creation and lookup now settle on the same string;album_or_createalready created under the trimmed name. Onupdatethe refusal runs beforefind_album, so nothing at all is sent. Four tests incommands/albums.rscover both doors and both the empty and the padded name; the two refusal tests assert the stub recorded no calls.Whether the server should also refuse an empty album name is still open and belongs in
imogen-server.