fix(nostr): log publish skips at WARNING instead of silently #54

Merged
padreug merged 1 commit from fix/publish-skip-logging into main 2026-09-26 21:37:04 +00:00
Owner

Two log lines. publish_or_delete_nostr_event had 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 level
  • nostr_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 Q6mhQQzQPSXqkQuFndzXnf drifted for 14 days — the relay served tickets_available=48 against 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-existing crud.py / nostr_sync.py annotations 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.json bump here, per the release procedure — version gets cut on main.

Two log lines. `publish_or_delete_nostr_event` had 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 level - `nostr_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 `Q6mhQQzQPSXqkQuFndzXnf` drifted for 14 days — the relay served `tickets_available=48` against 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-existing `crud.py` / `nostr_sync.py` annotations 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.json` bump here, per the release procedure — version gets cut on main.
fix(nostr): log publish skips at WARNING instead of silently
Some checks failed
lint.yml / fix(nostr): log publish skips at WARNING instead of silently (pull_request) Failing after 0s
165787d134
Both paths that decline to publish a NIP-52 calendar event were
invisible at the INFO level instances actually run at: the
`signer is None` branch returned bare with no log at any level, and
the missing-client branch logged at debug.

A skipped publish leaves the relay serving whatever inventory it last
saw, so the public ticket count stops tracking the DB with nothing to
indicate it. That has now been found twice, both times only because a
human noticed a wrong number on a public page — #35 on aio-demo, and
on cfaun where an event drifted for 14 days and produced no log line
at all, success or failure.

Both messages name the event id and whether it was a publish or a
delete, so a skip can be tied to a specific event without correlating
timestamps by hand.

Refs #51
padreug deleted branch fix/publish-skip-logging 2026-09-26 21:37:04 +00:00
padreug referenced this pull request from a commit 2026-09-27 07:27:48 +00:00
padreug referenced this pull request from a commit 2026-09-28 22:02:56 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/events!54
No description provided.