mirror of
https://github.com/kuhyx/signal-bot.git
synced 2026-11-11 21:23:48 +01:00
DOCS-signal-envelopes.md exists because this wire format is not obvious and guessing at it has cost real bugs -- the sticker read off the wrong nesting level, and 0.0.3's !gekon shipping green on an assumption nobody had checked against the live API. The recurring cost is that answering "what does a frame with an attachment actually look like?" needed a code change, a restart, and somebody sending one at the right moment. So at DEBUG the dispatcher now logs each frame's *shape*: keys and value types, never values. Two fields keep their values because they are wire format rather than anything a person said -- a MIME type and a groupInfo type. A message body, a name, a number, a uuid, quoted text and a sticker id all come out as "str". An album collapses to one element and a count instead of printing the same dict twenty times. Verified against a live frame: the body, the quoted text, the uuid and the phone number do not survive, and contentType does. This also had to fix DEBUG being unusable. LOG_LEVEL=DEBUG set the root logger, which turns on httpx, httpcore and asyncio; the bot polls a group listing every 30 seconds, so the one interesting line arrived buried and journald started dropping. Libraries are now held at WARNING whatever the bot is set to -- at INFO httpx was already emitting an "HTTP Request: GET ... 200 OK" line every thirty seconds, forever. Measured on the running unit: 17 library lines per minute down to 2. Two bugs in that setup found by its own tests rather than by review: basicConfig is a documented no-op once the root logger has a handler, so the level silently did not apply under pytest; and the floor belongs at INFO too, not only below it. A self-send does not produce a capturable attachment envelope, by the way -- signal-cli emits no syncMessage for a send made over the same connection. Two probe images returned HTTP 201 and no frame came back, so the inbound shape still needs a human to post one. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015d48t4qsQLBJnDwDeo2Nom |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| conftest.py | ||
| test_allowlist.py | ||
| test_animals.py | ||
| test_announce.py | ||
| test_app.py | ||
| test_bot.py | ||
| test_changelog.py | ||
| test_cli.py | ||
| test_config.py | ||
| test_counting.py | ||
| test_decorators.py | ||
| test_discovery.py | ||
| test_dispatcher.py | ||
| test_envelope_shape.py | ||
| test_fake_account.py | ||
| test_fake_groups.py | ||
| test_fake_server.py | ||
| test_folding.py | ||
| test_healthz.py | ||
| test_http_client.py | ||
| test_liveness.py | ||
| test_logging_setup.py | ||
| test_main.py | ||
| test_membership.py | ||
| test_models.py | ||
| test_popes_command.py | ||
| test_portcheck.py | ||
| test_portraits.py | ||
| test_quoting.py | ||
| test_registry.py | ||
| test_scenario.py | ||
| test_scheduler.py | ||
| test_selftest.py | ||
| test_startup.py | ||
| test_stats_backfill.py | ||
| test_stats_events.py | ||
| test_stats_nightly.py | ||
| test_stats_periods.py | ||
| test_stats_render_day.py | ||
| test_stats_text.py | ||
| test_store.py | ||
| test_transport_base.py | ||
| test_transport_fake.py | ||
| test_transport_rest.py | ||
| test_trust.py | ||
| test_versioning.py | ||