Repository navigation
fix(mcp): keep tag values verbatim in nostr_publish_event - #558
Merged
Merged
Conversation
nestedTexts reused texts(), which trims values and drops empty ones. Tags are positional, so ["p", pk, "", "mention"] went out as ["p", pk, "mention"], moving the marker into the relay-hint slot. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- nostr-java (all modules): 2.4.0 → 2.4.1 (patch) [maven] Fixed: nostr_publish_event dropped empty tag values and trimmed the rest, so positional tags like ["p", pk, "", "mention"] shifted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Summary
nostr_publish_eventdropped empty tag values and trimmed the others. NIP-01 tags are positional, so["p", pk, "", "mention"]was signed and published as["p", pk, "mention"]: the marker landed in the relay-hint slot, and the event that went out was not the one previewed for approval.Found in production: a NIP-84 highlight's recomputed id didn't match the approved event file, and diffing the live event against it showed the shifted
ptag.Type of change
fix- Bug fix (non-breaking)test- Adding or updating testschore- Build, CI, or tooling changes (version bump to 2.4.1)What changed?
ToolArguments.nestedTexts()reusedtexts(), which trims values and filters out empty strings. That is right for flat lists (ids, relays), wrong for tags. It now maps inner values withString::valueOfand nothing else.texts()is unchanged for its other callers.nestedTexts()has one caller,PublishEventTool, so nothing else is affected.ToolArgumentsTest: empty values keep their position, values aren't trimmed, and the flat-tag path behaves the same.[2.4.1]section, docs version reference.Testing
mvn clean test(the three new tests failed before the fix)mvn verify(requires Docker), not run locallyReview focus
Targets
mainrather thandevelop, matching #557:developis still at 2.3.1 and doesn't contain 2.4.0.Checklist
type(scope): description🤖 Generated with Claude Code