Skip to content

Commit f70fd90

Browse files
d-csclaude
andcommitted
perf(webapp): match gate bypass list in pre-gate claim eligibility
debounce and oneTimeUseToken triggers always return pass_through from the mollifier gate (`mollifierGate.server.ts:158-175`), so the pre-gate claim was issuing an unnecessary Redis SETNX on the trigger hot path for these trigger types. Mirror the gate's bypass list — exclude debounce + oneTimeUseToken alongside the existing resumeParentOnCompletion check — so the claim's RTT only fires when the gate could actually mollify the request. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0102c05 commit f70fd90

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

apps/webapp/app/runEngine/concerns/idempotencyKeys.server.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,16 @@ export class IdempotencyKeyConcern {
287287
// DB query, same predicate the gate uses — keeping the claim's Redis
288288
// RTT off the hot path for non-opted-in orgs during incremental
289289
// rollout.
290+
// Match the gate's bypass list (`mollifierGate.server.ts:158-175`).
291+
// debounce + oneTimeUseToken triggers always return pass_through from
292+
// the gate, so claiming a Redis SETNX here is wasted RTT on the
293+
// trigger hot path. Excluding them keeps the claim aligned with the
294+
// gate — if the gate would never mollify the request, there's no
295+
// buffer to serialise against.
290296
const claimEligible =
291297
!request.body.options?.resumeParentOnCompletion &&
298+
!request.body.options?.debounce &&
299+
!request.options?.oneTimeUseToken &&
292300
(await resolveOrgMollifierFlag({
293301
envId: request.environment.id,
294302
orgId: request.environment.organizationId,

0 commit comments

Comments
 (0)