mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-10-31 08:01:57 +01:00
Some faults cannot be diagnosed from a screenshot on a server we have no access to. The one that prompted this: a sent channel message gets no repeater badge, and nothing in the database distinguishes "nobody in earshot repeated it" from "the repeat came back over the air but the firmware dropped the RX-log frame before the app ever saw it". Settings > Diagnostics records a bounded window into a zip: every RX-log frame, the echo correlator's decision (with the pending-send list that explains a non-match), what each send expected to hear back, the application log at DEBUG, and the device's own packets.recv counter at both ends of the window. That last comparison is the whole point - it turns the firmware's silent 4-frame queue overflow into a measurement instead of a hypothesis. scripts/diag_report.py reads a capture offline and prints the verdict. Captures can be downloaded, or uploaded to a Zipline instance once the user pastes a token handed to them out-of-band. The URL ships as a default; the token never does, because this repository is public. - Hot path follows observer.py's contract: one deque append, no locks, no I/O. The log handler uses a no-op lock object rather than lock = None, which raises under Python 3.13's `with self.lock` in Handler.handle() - latent on the 3.11 container, fatal on 3.13 - Caps: 5/15/30/60 min, 25 MB, 10 stored captures. All enforced by the writer thread, so a user stop and an auto-stop finalise identically - The capture contains the text of messages received while it runs; the UI states this and confirms before any upload Also drops a redundant function-local `from flask import current_app` in get_status(): it shadowed the module-level import for the whole function and broke /api/status as soon as anything referenced current_app above it. Found by the capture tool, in its own change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>