Fix watchdog gaps, image failures and stale reminders

- catch httpx errors on send/heartbeat so a dead signal-api alerts instead
  of failing silently
- never let compose/images block the text post; count failed attempts
- drop reminders for events removed from the feed, using the feed's
  coverage horizon so the 30-event cap does not mark future events gone
- persist feed validators only after a successful parse
- do not seed from an empty feed
- flatten transparent images onto white; catch decompression bombs
- --dump uses a throwaway database
- avoid duplicated postcode in the venue line
- remove dead code; add regression tests
This commit is contained in:
2026-11-18 16:42:47 +00:00
parent 234c990e84
commit bdd41929d4
11 changed files with 483 additions and 137 deletions
+13
View File
@@ -96,3 +96,16 @@ def test_missing_fields_are_omitted():
text = render_post(event, FormatConfig(), LONDON, venue="", postcode="", link="")
lines = text.splitlines()
assert lines == ["Folk Night", "#November #November14", "4.30-6.30pm"]
def test_postcode_is_not_duplicated_when_part_of_venue():
event = make_event(location="Old Print Works B12 9AH", url="")
text = render_post(
event,
FormatConfig(),
LONDON,
venue="Old Print Works B12 9AH",
postcode="B12 9AH",
link="",
)
assert text.splitlines()[3] == "Old Print Works B12 9AH"