feat: answer REQ with CLOSED when no relay is configured #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/closed-on-req"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Port of the one piece of the upstream PR (lnbits/nostrclient#74) that isn't in our fork yet: a
REQreceived while nostrclient has no relay configured at all is answered with["CLOSED", <sub_id>, "error: no relay connections"]and not registered. Idea taken from lnbits/nostrclient#68 (BenGWeeks), credited there.Deliberately keyed on "no relay configured", not "none connected": a configured relay that is merely reconnecting gets the cached subscription replayed by the relay manager, so refusing the REQ in that state would be a regression. The OK path (PR #3) keeps using connected relays, which is the right condition for a one-shot publish.
router.py,tests/test_router_ok.pyand the README line are byte-identical to what was pushed upstream, so the fork and upstream stay aligned for the eventual rebase (#4).Verification
pytest nostrclient/tests: 9 passed (2 new: CLOSED when nothing configured; subscription kept when a configured relay is disconnected).Release
Version bumped to
1.2.0-aio.3in a separate commit. After merge: tag, hash, new catalog entry (keep1.2.0-aio.2).Upstream state
🤖 Generated with Claude Code
https://claude.ai/code/session_013Tbyw6FwjhEJg3gHfPHxWt