fix(nostr): log publish skips at WARNING instead of silently #54
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/publish-skip-logging"
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?
Two log lines.
publish_or_delete_nostr_eventhad two paths that decline to publish and leave nothing in the journal at the INFO level instances run at:nostr_hooks.py—if signer is None: return, a bare return with no log at any levelnostr_publisher.py—if not nostr_client: logger.debug(...)Both now log at WARNING, naming the event id and whether it was a publish or a delete.
A skipped publish means the relay keeps serving whatever inventory it last saw, so the public ticket count stops tracking the DB with nothing to indicate it. That has been found twice now, both times only because a human noticed a wrong number on a public page: #35 (aio-demo, Sep 5) and cfaun, where
Q6mhQQzQPSXqkQuFndzXnfdrifted for 14 days — the relay servedtickets_available=48against a DB reading 45 — and produced no log line at all, success or failure.That second case is why this is separate from #35. #35's proposal raises the exception paths to ERROR and adds retry; neither of these two branches raises, so they'd still have been silent.
Testing
67 passed(existing suite, no behaviour change). ruff clean; black leaves both files unchanged; mypy reports only the pre-existingcrud.py/nostr_sync.pyannotations from the newer-lnbits quick path.Note on closing
Refs #51 rather than Closes — deliberately no auto-close. We still don't know which of the two branches is firing on cfaun, and this PR is the instrument for finding out. Worth leaving #51 open until this is deployed there and the next sale tells us, then closing it with the answer recorded.
No
config.jsonbump here, per the release procedure — version gets cut on main.