Skip to content

Commit ae97162

Browse files
authored
chore(db): drop whitelabel_settings and rate_limit_bucket, remove the abort rewrite (#10303)
* chore(db): drop organization.whitelabel_settings and rate_limit_bucket * chore(next): remove the /api/copilot/chat/abort compatibility rewrite * chore: describe the Redis-only provider admission store and trim the 0470 header
1 parent 695ca94 commit ae97162

7 files changed

Lines changed: 33810 additions & 21 deletions

File tree

‎apps/sim/lib/core/rate-limiter/provider-admission.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export class ProviderAdmissionTimeoutError extends Error {
6565
/**
6666
* Shared per-credential admission for indexing workers and interactive callers.
6767
* These are deployment operating budgets, not claims about provider quotas.
68-
* Redis and PostgreSQL use the same durable token buckets; storage errors fail
69-
* before the provider request. Capacity is spent only when every dimension and
68+
* The token buckets live in Redis; storage errors fail before the provider
69+
* request. Capacity is spent only when every dimension and
7070
* the shared provider cooldown permit the request in one atomic operation.
7171
*/
7272
export async function waitForProviderAdmission(input: ProviderAdmissionInput): Promise<void> {

‎apps/sim/next.config.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -684,12 +684,6 @@ const nextConfig: NextConfig = {
684684
source: '/favicon.ico',
685685
destination: '/icon.svg',
686686
},
687-
/**
688-
* Serves Stop from browser tabs still on v0.9.64 or earlier, which call the old abort
689-
* path. Remove in any release after the first one that ships the move (the release
690-
* after v0.9.64).
691-
*/
692-
{ source: '/api/copilot/chat/abort', destination: '/api/mothership/chat/abort' },
693687
],
694688
/**
695689
* Fallback rewrites run only after every page and dynamic route has failed to match, so
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- Each drop autocommits under a short lock timeout so a busy table fails fast for migrate.ts to retry
2+
-- rather than queue traffic behind its ACCESS EXCLUSIVE lock. rate_limit_bucket has no FKs.
3+
COMMIT;--> statement-breakpoint
4+
SET lock_timeout = '100ms';--> statement-breakpoint
5+
-- migration-safe: contract of #10269 (shipped in v0.9.65): whitelabeling was removed and no release from v0.9.65 on declares, reads, or writes whitelabel_settings.
6+
ALTER TABLE "organization" DROP COLUMN IF EXISTS "whitelabel_settings";--> statement-breakpoint
7+
-- migration-safe: contract of #10272 (shipped in v0.9.65): Redis is required and the Postgres token bucket and provider-capacity store that used rate_limit_bucket were removed.
8+
DROP TABLE IF EXISTS "rate_limit_bucket";--> statement-breakpoint
9+
SET lock_timeout = '5s';

0 commit comments

Comments
 (0)