Skip to content

fix(desktop): deliver and retain Inbox DM messages - #5635

Open
skulk-and-quarrel wants to merge 2 commits into
block:mainfrom
skulk-and-quarrel:agent/dm-inbox-nip10-replies
Open

fix(desktop): deliver and retain Inbox DM messages#5635
skulk-and-quarrel wants to merge 2 commits into
block:mainfrom
skulk-and-quarrel:agent/dm-inbox-nip10-replies

Conversation

@skulk-and-quarrel

@skulk-and-quarrel skulk-and-quarrel commented Aug 12, 2026

Copy link
Copy Markdown

Summary

  • route Inbox sends through the same mutation as the channel composer, so direct-message participants receive the implicit p tags required for delivery
  • update the shared channel-window cache for Inbox sends, preventing a locally rendered message from being replaced after newer activity
  • keep a selected Inbox DM subscription live and hydrate recent DM content with ordinary NIP-10 replies
  • add unit and browser regression coverage for both the hidden-agent-reply and Inbox-send paths

Fixes #5632.

Root cause

The screenshot's highlighted Inbox send is signed event 929865d3c0…. Its only tag is the DM channel's h tag: it has neither a participant p tag nor a thread e tag.

Inbox called sendChannelMessage directly with only the composer's explicit @mention pubkeys. When the user typed no explicit mention, the event was published as h-only. The normal channel composer instead uses useSendMessageMutation, whose messageMentionPubkeys step adds every other DM participant. Without Honey's p tag, the managed-agent harness was not addressed, explaining the missing working reaction, activity, and reply.

That separate Inbox send path also bypassed the shared channelWindowStore optimistic/success reconciliation used by the DM conversation. A locally rendered Inbox row could therefore be replaced when a later send or refresh re-projected the authoritative channel window.

There was a second projection gap: managed-agent responses sent as ordinary NIP-10 replies are intentionally absent from stream-style top-level channel windows. Inbox previously treated a DM as a flat conversation but consumed only that top-level projection, so a persisted agent reply could be visible in activity while absent from Inbox DM detail.

Fix

Inbox now uses the shared send mutation for every supported channel. For DMs this adds the implicit participant tags and updates the same cache consumed by the conversation view.

Selected Inbox DMs also keep their subscription live, retain normal reply events in the DM window, and merge a recent direct channel-content fetch into Inbox context.

Testing

Verified on commit 45c60632ff8c69b8ebe895fbefc4696a2dd43112:

  • just ci — passed (formatting, lint/type/file-size gates, Rust, desktop, web, and mobile suites)
  • cd desktop && pnpm build:e2e && pnpm exec playwright test tests/e2e/channels.spec.ts --grep 'Inbox DM send addresses the participant and survives a newer channel send' — passed
  • the browser regression asserts that an Inbox DM send carries the other participant's p tag, remains visible after opening the conversation, and survives a newer send

Co-authored-by: Emre <skulk-quarrel@hotmail.com>
Signed-off-by: Emre <skulk-quarrel@hotmail.com>
@skulk-and-quarrel skulk-and-quarrel changed the title Fix Inbox DM replies fix(desktop): retain NIP-10 replies in Inbox DMs Aug 12, 2026
@skulk-and-quarrel
skulk-and-quarrel force-pushed the agent/dm-inbox-nip10-replies branch from 27b2ee1 to 4244af9 Compare August 12, 2026 07:00
Co-authored-by: Emre <skulk-quarrel@hotmail.com>
Signed-off-by: Emre <skulk-quarrel@hotmail.com>
@skulk-and-quarrel skulk-and-quarrel changed the title fix(desktop): retain NIP-10 replies in Inbox DMs fix(desktop): deliver and retain Inbox DM messages Aug 12, 2026
@skulk-and-quarrel
skulk-and-quarrel marked this pull request as ready for review August 12, 2026 07:51
@skulk-and-quarrel
skulk-and-quarrel requested a review from a team as a code owner August 12, 2026 07:51
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.

Inbox replies to managed agents can disappear before delivery

1 participant