File tree Expand file tree Collapse file tree
apps/sim/app/api/auth/oauth Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -680,11 +680,13 @@ interface CoalescedRefreshOutcome {
680680/**
681681 * Slack lock budgets sized past `TOKEN_REFRESH_TIMEOUT_MS` (15s) in
682682 * lib/oauth/oauth.ts: installation-keyed locks make every sibling row's request
683- * a follower of one refresh, so followers must keep polling for the leader's
684- * full provider window and the lock must not expire under a live refresh.
683+ * a follower of one refresh. The lock TTL must not expire under a live refresh
684+ * (15s provider call plus DB reads and the fan-out write), and followers poll
685+ * for the lock's full lifetime so a slow-but-successful refresh is still
686+ * observed rather than reported as a failure.
685687 */
686- const SLACK_FOLLOWER_MAX_WAIT_MS = 16_000
687688const SLACK_LOCK_TTL_SEC = 20
689+ const SLACK_FOLLOWER_MAX_WAIT_MS = SLACK_LOCK_TTL_SEC * 1000
688690
689691async function performCoalescedRefresh ( {
690692 accountId,
You can’t perform that action at this time.
0 commit comments