NIP-52 publish can be skipped silently — both early-returns need to log #51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
publish_or_delete_nostr_eventhas two paths that skip publishing without leaving anything in the journal at INFO:nostr_hooks.py:34—if signer is None: return. Bare return, no log at any level.nostr_publisher.py:175—if not nostr_client: logger.debug(...). LNbits runs at INFO, so it never appears.On cfaun this hid a 14-day inventory drift on
Q6mhQQzQPSXqkQuFndzXnf(URU ECSTATIC DANCE). The event sold 5 tickets; the relay kept servingtickets_available=48 tickets_sold=2from Sep 12, and oyez.ariege.io rendered 48 because that's what the relay gave it.Timeline from the ticket table and the journal:
soldreached 5 in the DB, and onlyset_ticket_paidwrites that counter, so the publish hook definitely ran three more times.events.nostr_event_created_atis still 1789211268 andnostr_event_idstill756fed21…, which is what the relay holds — so no publish succeeded after Sep 12.The absence of a log line is itself the proof of where it bailed:
publish_event_to_nostrlogsPublished NIP-52 calendar eventimmediately afterawait nostr_client.publish_nostr_event(...), and that call only puts the event onsend_req_queue— it confirms nothing. So the success line fires even when the relay never receives the event. Not seeing it means we never reached it, i.e. one of the two silent returns above.What to change
Both skips should log at WARNING with the event id, e.g.
logger.warning(f"[EVENTS] No signer for wallet {event.wallet}, skipping NIP-52 publish for {event.id}")logger.warning(f"[EVENTS] No NostrClient, skipping NIP-52 publish for {event.id}")A skipped publish means the public ticket count silently stops tracking reality — that is not a debug-level event.
Side note for whoever picks this up
Until this lands, the two branches are distinguishable by running the instance at DEBUG and re-triggering a publish (edit the event in the admin UI):
[EVENTS] No NostrClient available, skipping publishappears → thenostr_clientglobal is falsyresolve_for_wallet(event.wallet)returned NoneOn cfaun the Sep 20 start was clean and single (one
Registered nostr-transport RPCs, NostrClient connected and subscribed), which makes the signer branch the better bet there — worth confirming before assuming.