fix(cli): handle empty-value tag edits in interactive tag prompt#539
Merged
Conversation
The interactive tag editor keyed removal on `value == "" && tags[key] != ""`, so it refused to remove a tag whose current value was already empty and stayed silent when a newly entered key didn't exist (the key just vanished). Check key existence explicitly: an empty value removes the tag if present, otherwise reports "nothing to remove". Applied to both the native and WASM prompt paths, which had drifted out of sync.
Phil-Browne
added a commit
that referenced
this pull request
Jul 11, 2026
The GetIntFromInterface int-width bound fix and the interactive tag-editing empty-value fix are orthogonal to the prompt/validator parity work here, so they were pulled into their own PRs: - GetIntFromInterface overflow bound -> #538 - interactive tag-edit empty-value handling -> #539 Restores those six files to the main baseline; this PR now stays focused on partner-config and prefix-filter validation parity.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #539 +/- ##
==========================================
+ Coverage 78.57% 78.58% +0.01%
==========================================
Files 192 192
Lines 18522 18525 +3
==========================================
+ Hits 14553 14558 +5
+ Misses 2904 2902 -2
Partials 1065 1065
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes edge cases in the interactive tag editor so that entering an empty value removes an existing tag regardless of its current value (including already-empty values), and produces deterministic feedback when attempting to remove a non-existent key. The change is applied consistently across both native and WASM prompt implementations to prevent behavior drift.
Changes:
- Update tag-edit removal logic to check key existence explicitly (instead of
tags[key] != ""). - Add regression tests for the native prompt behavior (empty-existing-value removal and no-op removal attempt).
- Add a WASM regression test for the “remove non-existent key” no-op case.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/utils/prompts.go | Fix native interactive tag-removal semantics by checking key existence. |
| internal/utils/prompts_wasm.go | Mirror the native fix in the WASM prompt path to eliminate drift. |
| internal/utils/prompts_wasm_test.go | Add a regression test for the WASM “empty value for missing key” no-op behavior. |
| internal/utils/prompts_test.go | Add native regression tests for removing empty-valued tags and handling empty values for new keys. |
penzeliz-megaport
approved these changes
Jul 13, 2026
penzeliz-megaport
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed for correctness; no findings. LGTM.
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.
Extracted from #535 (ESD-1648) as a standalone fix, orthogonal to the validator-parity work in that PR.
The interactive tag editor keyed removal on
value == "" && tags[key] != "", which had two bugs:Now key existence is checked explicitly: an empty value removes the tag if present, otherwise reports "nothing to remove". Fixed in both the native (
prompts.go) and WASM (prompts_wasm.go) paths, which had drifted out of sync.