Repository navigation
perf(discord): avoid duplicate inbound binding lookup - #128264
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready review complete for exact head The current-base regression failed for the intended reason ( Verified locally:
Exact-head hosted CI is green: run 32650382638. Repository-native Proof gap: no live Discord channel run was performed. This is a behavior-neutral internal lookup reduction; full owner/sibling/extension coverage preserves bot/webhook filtering, canonical route/touch behavior, DMs/group DMs, PluralKit, media, mentions, room events, auth, privacy, and durable ordering. |
|
Merged via squash.
|
What Problem This Solves
Resolves avoidable work on every accepted ordinary Discord guild message. Human guild traffic looked up the same thread binding before route resolution and again in the canonical conversation-binding route, even though only bot and webhook traffic can use the early result for self-loop rejection.
Why This Change Was Made
The Discord preflight owner now performs the pre-routing binding lookup only for bot or webhook traffic. Ordinary human messages reach the single authoritative conversation-binding route lookup. This adds no cache and does not change DMs, group DMs, thread routing, bound webhook/bot filtering, PluralKit handling, authentication, privacy, ordering, media, mentions, or durable admission.
User Impact
Ordinary Discord guild messages avoid one redundant thread-binding lookup while retaining identical routing and delivery behavior.
Evidence
cd86b59a35a5ed1eafa4a9a9155b608cc201d23b; exact candidate:646aea9a1d5e057d0ca1584bdc605373314f4cc4.getByThreadIdtwice instead of once. The candidate passes with one canonical lookup.node scripts/check-changed.mjs -- extensions/discord/src/monitor/message-handler.preflight.ts extensions/discord/src/monitor/message-handler.preflight.test.tspnpm buildgit diff --checkgpt-5.6-sol/high autoreview: clean, patch correct (0.95), no accepted/actionable P0/P1 findings; TruffleHog preflight clean.origin/mainadvanced to20cdebb23dacb7f9ae21f28dd07a9ef8d837fe88without touching either changed file; the patch applies cleanly there, so the proven commit was not rebased solely for drift.95079949c3a2dab3380efe7593b34f02a416153fon 2026-04-05, authored and committed by Gustavo Madeira Santana. No associated PR is traceable from GitHub, so no PR attribution is inferred.