Skip to content

fix(cli): report the actual outcome of tags --add and --remove - #2416

Merged
igamigo merged 2 commits into
0xMiden:nextfrom
Ruzzgar:fix-tag-command-output
Aug 20, 2026
Merged

fix(cli): report the actual outcome of tags --add and --remove#2416
igamigo merged 2 commits into
0xMiden:nextfrom
Ruzzgar:fix-tag-command-output

Conversation

@Ruzzgar

@Ruzzgar Ruzzgar commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

tags --add and tags --remove print that the tag was added or removed no matter what happened. The store already reports whether a row was written or deleted, but Client::add_note_tag and Client::remove_note_tag drop that and only warn! about it, so the command ends up contradicting its own log line:

$ miden-client tags --remove 999
WARN miden_client::sync::tag: Tag 999 wasn't being tracked
Tag 999 removed

$ miden-client tags --add 42
Tag 42 added
$ miden-client tags --add 42
WARN miden_client::sync::tag: Tag 42 is already being tracked
Tag 42 added

Both methods now return that flag instead of logging it, and the CLI prints accordingly:

$ miden-client tags --remove 999
Tag 999 wasn't being tracked
$ miden-client tags --add 42
Tag 42 added
$ miden-client tags --add 42
Tag 42 is already being tracked

The return type change doesn't touch any existing caller, since ? and unwrap() discard the bool, so only tags.rs needed updating. Extended the existing tags test to assert the returned value, and fixed the Store::remove_note_tag doc comment, which described a bool return the method doesn't have.

@igamigo igamigo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@igamigo
igamigo merged commit 1e85a95 into 0xMiden:next Aug 20, 2026
19 checks passed
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.

2 participants