Skip to content

Fix duplicated self DMs and publishing to NIP-42 auth relays - #44

Merged
mattn merged 1 commit into
mainfrom
fix/dm-dup-and-publish-auth
Nov 16, 2026
Merged

mattn merged 1 commit into
mainfrom
fix/dm-dup-and-publish-auth

Conversation

@mattn

@mattn mattn commented Nov 16, 2026

Copy link
Copy Markdown
Owner
  • dm timeline -u me showed every message twice: the two kind 4 queries are identical when the peer is yourself, and both gift wraps of a NIP-17 DM to yourself unwrap to the same rumor. Skip the redundant query and dedupe rumors by their own ID.
  • Publishing to a relay that rejects with auth-required: always failed because Do opens a fresh connection that preAuth never authenticated. Add publishEvent, which authenticates on that connection and retries once, and use it for every publish (except NWC).

Verified with nak serve / nak serve --auth.

dm timeline -u me listed every message twice: both kind 4 queries are
the same when the peer is yourself, and the recipient and sender gift
wraps of a NIP-17 DM to yourself unwrap to the same rumor. Skip the
redundant query and dedupe rumors by their own ID.

Publishing to a relay that answers auth-required always failed, because
Do opens its own connection that preAuth never authenticated. Authenticate
on that connection and retry once.
@mattn
mattn merged commit 5175ccc into main Nov 16, 2026
2 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.

1 participant