fix: tighten the faq-bot responder and the catalogue's publish gates - #95
Merged
Conversation
…failed send A sticker, image or voice note arrives with an empty body. No rule can match one, so the fallback answered a picture with "I did not understand" — and returning true claimed the event, so a plugin that could actually handle media never saw it. The guard now requires text, the way chat-flow's does. The fallback cooldown slot is claimed before the send. When the send threw, the window was spent anyway and the chat stayed silent over a reply that never arrived. The slot is released on failure: a message that matches a rule is retried on the next message too, so this costs at most one send attempt each.
Every path in this repo is built from the directory name — the plugin folder, the zip, the release tag — while `manifest.id` is what the host installs under and what the catalogue publishes. Nothing compared them, so a mismatch would have the download URL point at one plugin while the installed plugin called itself another. The download URL is also derived from `manifest.repository`, and nothing constrained its host. Pointing it at a foreign repo would have the catalogue hand users an archive nobody here built or checksummed. The author field is unaffected: a plugin may credit anyone, but the artifact has to come from a repo this project publishes.
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.
Four defects: two in how the FAQ responder decides to answer, two in what the catalogue is willing to publish.
faq-bot — answering things it cannot answer
A sticker, image or voice note arrives with an empty body. No rule can match one, so the fallback replied to a picture with "I did not understand" — and returning true claimed the event, so a plugin that could actually handle media never saw it. The guard now requires text, which is how
chat-flowalready guards the same hook.The fallback cooldown slot is claimed before the send. When the send threw, the window was spent on a reply that never arrived and the chat stayed silent for its full duration — by default ten minutes. The slot is now released on failure. A message matching a rule is retried on the next message anyway, so this costs at most one send attempt per message rather than one per window.
catalog — two things nothing was checking
manifest.idwas never compared to the directory name. Every path in this repo is built from the directory — the plugin folder, the zip, the release tag — whilemanifest.idis what the host installs under and what the catalogue publishes. A mismatch would have the download URL point at one plugin while the installed plugin called itself another.manifest.repositoryhad no constraint on its host, and the catalogue derives every download URL from it. Pointing it at a foreign repo would have the catalogue hand users an archive nobody here built or checksummed. Theauthorfield is deliberately unaffected — a plugin may credit anyone; the artifact has to come from a repo this project publishes.Verification