Commit graph

13 commits

Author SHA1 Message Date
7aa0ce14db feat: reply OK to client-published events
nostrclient never answered a client's EVENT with the NIP-01
`["OK", <id>, <accepted>, <message>]` command result. Clients built on
nostr-tools and similar libraries wait for that reply before treating a
publish as successful, so NWC wallet apps paired through the public
endpoint reported "publish failed" even though the request had been
fanned out and answered.

Relay OKs now flow through the message pool like events and notices.
The router tracks each EVENT a client publishes and replies exactly
once: `true` as soon as any relay accepts, `false` once every relay
connected at publish time has rejected it, after a 10 s timeout, or
immediately when no relay is connected. OKs nobody is waiting on are
dropped at the pump so the shared result map cannot grow unbounded.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tbyw6FwjhEJg3gHfPHxWt
2026-09-12 13:31:00 +02:00
PatMulligan
e66f997853
FIX: Ensure valid json (#39)
* Build EVENT message with json.dumps instead of string interpolation

Ensures outbound Nostr messages are valid JSON and safely escaped by
constructing the payload as Python objects and serializing with
json.dumps

* improve logs

* remove log causing check failure
2025-09-15 13:42:33 +03:00
dni ⚡
bd355a8a01
fixup! 2025-09-10 10:12:57 +02:00
dni ⚡
db20915756
v1 in the middle (#32) 2024-10-31 13:15:31 +02:00
dni ⚡
a8eb139360
feat: code quality (#31)
* feat: code quality
2024-08-30 13:07:33 +02:00
Vlad Stan
a119c3836a
Improve stability (#25)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
* chore: increase log level

* feat: secure relays endpoint

* feat: add config for the extension

* chore: update `min_lnbits_version`

* chore: improve logging

* fix: decrypt logic

* chore: improve logs
2024-01-22 13:46:22 +02:00
Vlad Stan
16ae9d15a1
Stabilize (#24)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
* refactor: clean-up

* refactor: extra logs plus try-catch

* refactor: do not use bare `except`

* refactor: clean-up redundant fields

* chore: pass code checks

* chore: code format

* refactor: code clean-up

* fix: refactoring stuff

* refactor: remove un-used file

* chore: code clean-up

* chore: code clean-up

* chore: code-format fix

* refactor: remove nostr.client wrapper

* refactor: code clean-up

* chore: code format

* refactor: remove `RelayList` class

* refactor: extract smaller methods with try-catch

* fix: better exception handling

* fix: remove redundant filters

* fix: simplify event

* chore: code format

* fix: code check

* fix: code check

* fix: simplify `REQ`

* fix: more clean-ups

* refactor: use simpler method

* refactor: re-order and rename

* fix: stop logic

* fix: subscription close before disconnect

* chore: play commit
2023-11-01 17:46:42 +02:00
Vlad Stan
e841183c10
fix: add extra checks (#21)
* fix: add extra checks

* fix: remove redundant try-catch
2023-09-25 10:13:55 +03:00
Vlad Stan
e6624f76bd
Performance improvements (#19)
* fix: increase the wait time for re-connecting to a relay

* fix: blocking sleep

* fix: remove blocking sleep

* fix: allow multiple filters per request
2023-09-12 15:06:28 +03:00
Vlad Stan
80b86bf00c fix: await even if error 2023-06-30 12:05:28 +03:00
Vlad Stan
1601f71b03 feat: show relay NOTICE 2023-06-30 11:46:47 +03:00
Vlad Stan
ada5b2a51d fix: unsubscribe 2023-06-29 15:48:28 +03:00
Vlad Stan
e04629db22 refactor: rename services to router 2023-06-23 11:18:09 +03:00
Renamed from services.py (Browse further)