docs(status): note the window the age cannot cover, and read better inside it - #8
Merged
Merged
Conversation
…nside it Review raised a case the age rendering cannot defend against, and it is worth writing down in both repos rather than leaving it to be rediscovered. The agent's MQTT will is fixed when its connection opens and the broker holds it, so a fault learned during that session never reaches it. If the agent is then killed, the broker publishes the older, healthier reading over the newer one and this page renders DISCONNECTED with a stale-healthy detail line. Nothing here can detect it -- retained MQTT v3.1.1 messages carry no publish timestamp -- so the note says where the recovery actually comes from: the agent restarts on a 5s systemd timer, seeds from its spool, which does have the fault, and republishes. Two review nits while here. `seen` is annotated `object` rather than `str | None`, because it comes out of json.loads on a payload this process did not produce and can be any JSON type; annotating it narrowly would move the lie into the signature. And under 10 seconds now reads "seen just now" instead of "seen 0s ago" -- that is the common case, since the page is usually looked at right after printing something.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #7, which merged before these review points were addressed. Same three changes, rebased onto the merged main.
The window the age cannot cover
Review raised a case this module cannot defend against, and it is worth writing down rather than leaving to be rediscovered.
The agent's MQTT will is fixed when its connection opens and the broker holds it, so a fault learned during that session never reaches it. Agent connects while the tape is fine → a print an hour later finds the tape gone and correctly publishes
media_ok: false→ agent is killed → the broker publishes the older, healthier reading over the newer one, and this page rendersDISCONNECTEDwith a stale-healthy detail line.Nothing here can detect it: retained MQTT v3.1.1 messages carry no publish timestamp. So the README note says where the recovery actually comes from rather than pretending to a fix — the agent restarts (
Restart=always,RestartSec=5), seeds from its spool, which does hold the fault, and republishes. Seconds wide, not indefinite.Worth being precise about what does not close it, since both were suggested:
on_disconnectfires with no connection to publish on, and a SIGKILL runs no callback at all. Re-arming the will on reconnect (done in sengine-cloud/labelfab#13) bounds it by the reconnect interval rather than the process lifetime, but cannot touch a live session. The recovery path is now pinned by a test upstream rather than left as an argument.Two nits
_ago'sseenis annotatedobject, deliberately notstr | None— it comes out ofjson.loadson a payload this process did not produce and can be any JSON type, so a narrow annotation would move the lie into the signature rather than remove it.Under 10 seconds renders
seen just nowinstead ofseen 0s ago. That is the common case, since the page is usually looked at right after printing something.Verified
49 tests on 3.12, 37 on a real 3.9.25 in Docker, ruff clean.