Skip to content

fix: use nostr-sdk more wihout breaking changes - #70

Merged
motorina0 merged 2 commits into
mainfrom
use_sdk_more
Jul 13, 2026
Merged

fix: use nostr-sdk more wihout breaking changes#70
motorina0 merged 2 commits into
mainfrom
use_sdk_more

Conversation

@arcbtc

@arcbtc arcbtc commented Jun 1, 2026

Copy link
Copy Markdown
Member

is much more stable

@motorina0 motorina0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
needs CI fix and testing

@talvasconcelos talvasconcelos left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, all works smooth

@dadofsambonzuki

Copy link
Copy Markdown

FYI - I reverted my fixes (PR #71) , which were working with NWC clients, with this change and now it is not working for me.

Investigating ...

@dadofsambonzuki

dadofsambonzuki commented Jul 1, 2026

Copy link
Copy Markdown

Root Cause Found & Fixed

The core bug: the SDK's RelayMessageEnum uses variant EVENT_MSG with method is_EVENT_MSG(), but the code was calling the nonexistent is_EVENT(). Every EVENT message arriving through handle_msg was silently dropped — they never entered the message pool.

This affected any subscription where the response arrives before subscribe_with_id_to registration completes (most notably limit: 1 subscriptions like kind 13194 used by NWC wallets).

Fix

Handled in PR #72 as I don't have access to branches here.

  • handle_msg: use is_EVENT_MSG() instead of is_EVENT(), handle OK messages
  • handle: add try/except with error logging
  • _broadcast_subscription / _replay_cached_subscriptions: register subscriptions via subscribe_with_id_to alongside raw REQ, so events also arrive through the handle callback for ongoing subscriptions

@motorina0
motorina0 merged commit ae674ef into main Jul 13, 2026
7 checks passed
@motorina0
motorina0 deleted the use_sdk_more branch July 13, 2026 12:14
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.

4 participants