Repository navigation
test: cover gateway inbound filters and webhook bind edges - #181
Draft
cursor[bot] wants to merge 1 commit into
Draft
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Discord ignores bots and strips only a leading mention before a mention-disabled post. Twitch ignores its own nick and a command-only reply. Telegram skips bots and chat-less updates and resets poll backoff after success. Webhook binds stay exact-match loopback, and a chunked body over the cap is rejected. Co-authored-by: moikapy <[email protected]>
This branch has not been deployed
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.
Risky behavior now covered
LICH_DISCORD_BOT_IDmention, and posts withallowed_mentions.parseempty so a reply cannot ping the room. A thrown handler becomes a one-lineagent errorand does not close the socket.PASS oauth:once (no doubled prefix), drops a reply that sanitizes to empty, and strips a leading/beforePRIVMSG.getUpdatesresult as no updates, skips bots and chat-less updates, keeps chat id0, uses the media placeholder, and resets poll backoff to the first delay after a successful poll.127.0.0.1,localhost,::1, including padding and case). Lookalikes ([::1],127.1,::ffff:127.0.0.1) stay refused, and the token is not logged. Non-object JSON is 400. Numeric chat and user ids are stringified. A chunked body over the byte cap, with no content-length, is 413 and never reaches the handler.Test files added/updated
test/gateway_inbound.test.tstest/gateway.test.tsWhy this reduces regression risk
These are the chat-adapter and webhook edges from the gateway work (#174, #178) that the existing bus, reconnect, and policy tests do not hit. A regression here is a bot echo loop, a Twitch command sent from the bot, a mention ping, a public bind without a token, or an unbounded webhook body. Sleep and sockets are scripted, so the new cases do not wait on live network or the 2–30s backoff.
Validation
node node_modules/vitest/vitest.mjs run test/gateway_inbound.test.ts test/gateway.test.ts— 49 passednode node_modules/typescript/bin/tsc --noEmit— passedbunordist/cli.jsis missing.