Visitar URL original
fix(webhooks): stop admission-refusal retry loops and per-retry log writes by waleedlatif1 · Pull Request #8870 · simstudioai/sim · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
2fc4095
fix(execution): tag deterministic admission rejections and throttle b…
waleedlatif1 Oct 10, 2026
474c73c
fix(webhooks): acknowledge deterministic admission rejections for Tel…
waleedlatif1 Oct 10, 2026
a4d0689
fix(webhooks): skip polls for over-limit payers and back off failing …
waleedlatif1 Oct 10, 2026
46beb99
fix(webhooks): stop Slack redelivering to deleted trigger paths and l…
waleedlatif1 Oct 10, 2026
0de6619
fix(telegram): verify webhook deliveries with a per-webhook secret token
waleedlatif1 Oct 9, 2026
1ec25a8
refactor(webhooks): declare the Telegram admission opt-in on its handler
waleedlatif1 Oct 10, 2026
36f8a58
fix(execution): only treat billing and account refusals as deterministic
waleedlatif1 Oct 10, 2026
2da70cf
fix(webhooks): keep a fan-out target's retryable failure visible past…
waleedlatif1 Oct 10, 2026
5a9a90b
fix(telegram): match the active bot through env-var token references
waleedlatif1 Oct 10, 2026
46fe011
fix(webhooks): skip polls only after a recorded refusal and back off …
waleedlatif1 Oct 10, 2026
a36665f
refactor(webhooks): route every poller's source failures through one …
waleedlatif1 Oct 10, 2026
27a04be
chore(webhooks): tighten poll comments and backoff tests
waleedlatif1 Oct 10, 2026
011e4bb
fix(webhooks): stop every poller's batch on a deterministic admission…
waleedlatif1 Oct 10, 2026
0cedd07
fix(webhooks): never replay completed poll work or mask a retryable f…
waleedlatif1 Oct 10, 2026
317463a
fix(execution): drop the unreachable billing-account admission code
waleedlatif1 Oct 10, 2026
3a141dd
chore(webhooks): key blocked-run claims by gate and centralize the po…
waleedlatif1 Oct 10, 2026
5fc969c
fix(telegram): match the active bot with the env the caller resolved …
waleedlatif1 Oct 10, 2026
6080fb0
chore(testing): stub IdempotencyService.createWebhookIdempotencyKey i…
waleedlatif1 Oct 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(execution): drop the unreachable billing-account admission code
A workspace without a billing account fails inside payer resolution and takes
the retryable attribution-error path; the branch that tagged
BILLING_ACCOUNT_REQUIRED only ran for an attribution with no actor, which
system attribution never produces. The branch goes back to its staging form
and the deterministic set keeps the usage limit and suspended accounts.
  • Loading branch information
waleedlatif1 committed Oct 10, 2026
commit 317463a7a4f4238285c50ea535bf4c796bbd651a
1 change: 0 additions & 1 deletion apps/sim/lib/core/admission/rejection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
export const ADMISSION_REJECTION_CODE = {
USAGE_LIMIT_EXCEEDED: 'USAGE_LIMIT_EXCEEDED',
ACCOUNT_SUSPENDED: 'ACCOUNT_SUSPENDED',
BILLING_ACCOUNT_REQUIRED: 'BILLING_ACCOUNT_REQUIRED',
} as const

const DETERMINISTIC_ADMISSION_REJECTION_CODES: ReadonlySet<string> = new Set(
Expand Down
10 changes: 0 additions & 10 deletions apps/sim/lib/execution/preprocessing.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1023,16 +1023,6 @@ describe('preprocessExecution admission rejection codes and blocked-run log thro
arrange: () => mockGetActivelyBannedUserIds.mockResolvedValue(['billed-account-1']),
expected: { statusCode: 403, code: ADMISSION_REJECTION_CODE.ACCOUNT_SUSPENDED },
},
{
gate: 'billing account',
arrange: () =>
mockResolveSystemBillingAttribution.mockImplementation((workspaceId: string) => ({
...ORGANIZATION_ATTRIBUTION,
actorUserId: '',
workspaceId,
})),
expected: { statusCode: 500, code: ADMISSION_REJECTION_CODE.BILLING_ACCOUNT_REQUIRED },
},
])('tags a $gate refusal with its stable code', async ({ arrange, expected }) => {
arrange()
const result = await refuse('workflow-1')
Expand Down
15 changes: 8 additions & 7 deletions apps/sim/lib/execution/preprocessing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,12 +579,7 @@ export async function preprocessExecution(
workspaceId,
})

const failure: PreprocessExecutionError = {
message: 'Unable to resolve billing account',
statusCode: 500,
code: ADMISSION_REJECTION_CODE.BILLING_ACCOUNT_REQUIRED,
}
await recordGateFailure(failure, {
await recordPreprocessingError({
workflowId,
executionId,
triggerType,
Expand All @@ -596,7 +591,13 @@ export async function preprocessExecution(
triggerData,
})

return { success: false, error: failure }
return {
success: false,
error: {
message: 'Unable to resolve billing account',
statusCode: 500,
},
}
}

if (!billingAttribution) {
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/lib/webhooks/polling/admission-refusals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const logger = createLogger('PollAdmissionRefusals')

/**
* How long a workspace's polls are skipped after execution admission refused a
* polled event for a reason that holds until a person acts (usage limit,
* suspended account, missing billing account). Polling resumes on its own after
* polled event for a reason that holds until a person acts (usage limit or a
* suspended account). Polling resumes on its own after
* this window, so a raised limit takes effect within it.
*/
const POLL_ADMISSION_REFUSAL_TTL_SECONDS = 5 * 60
Expand Down