#7562: fix: nostr plugin filter double-wrapping in subscribeMany
channel: nostr
Cluster:
Signal Plugin Enhancements
Change subscribeMany to subscribe and unwrap filter array to prevent relays from rejecting subscriptions with 'bad req' error.
subscribeMany internally wraps filters in an array, causing the filter to be sent as [[{...}]] instead of [{...}]. Using subscribe with an unwrapped filter object sends the correct format.
Fixes #7448
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the Nostr DM subscription setup in `extensions/nostr/src/nostr-bus.ts` to avoid double-wrapping the filter array when using `SimplePool.subscribeMany`. It switches to `pool.subscribe(...)` and passes a single filter object (`{ kinds: [4], "#p": [pk], since }`), which should prevent relays from rejecting the request with a `bad req` error caused by sending `[[{...}]]` instead of `[{...}]`.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- The change is a one-line switch from `subscribeMany` to `subscribe` to correct filter serialization; it is localized, aligns with the nostr-tools API expectations, and does not alter surrounding event handling logic.
- No files require special attention
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#11898: Fix for issue #11895
by rerickardjr · 2026-02-08
75.6%
#4562: fix(nostr): use dispatchReplyFromConfig for inbound messages
by Abhijrathod · 2026-01-30
75.1%
#4878: fix: string/type handling and API fixes (#4537, #4380, #4373, #4547...
by lailoo · 2026-01-30
74.7%
#15999: fix: handle null/undefined in activity feed filters
by pamnlambert · 2026-02-14
71.9%
#13881: fix: Address Greptile feedback - test isolation and channel resolution
by trevorgordon981 · 2026-02-11
70.7%
#9006: fix: streaming UI, session locks, routing performance, plugin sandb...
by facundollamas2007 · 2026-02-04
70.6%
#15900: fix(discord): filter bot's own messages early to prevent self-DoS
by Shuai-DaiDai · 2026-02-14
70.0%
#16507: feat(nostr): refactor channel dispatch logic (AI-assisted)
by tanujbhaud · 2026-02-14
69.5%
#14904: fix(nostr): handle string return from nip19.decode in normalizePubkey
by mcaxtr · 2026-02-12
69.4%
#21463: fix(discord): prevent WebSocket death spiral + fix numeric channel ID…
by akropp · 2026-02-20
69.2%