From 42237e414a2957d3627ea3ad48651960fbebc182 Mon Sep 17 00:00:00 2001 From: Ewan Croft Date: Thu, 13 Aug 2026 05:10:34 +0100 Subject: [PATCH] fix(rate-limit): align client fallbacks and opal point cost with Bluesky PDS rules - croft-click-core: handleRateLimitHit fallback window resetAt from 60s to 3600s - malachite: handleRateLimitHit fallback window resetAt from 60s to 3600s - opal: POINTS_PER_RECORD for applyWrites#create from 1 to 3 --- packages/croft-click-core/src/rate-limiter.ts | 2 +- packages/malachite/src/utils/rate-limiter.ts | 2 +- packages/opal/src/publisher.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/croft-click-core/src/rate-limiter.ts b/packages/croft-click-core/src/rate-limiter.ts index 307746c..982261e 100644 --- a/packages/croft-click-core/src/rate-limiter.ts +++ b/packages/croft-click-core/src/rate-limiter.ts @@ -71,7 +71,7 @@ export class RateLimiter { if (this.state) { this.state.remaining = 0; } else { - this.state = { limit: 5000, remaining: 0, resetAt: now + 60, windowSeconds: 3600 }; + this.state = { limit: 5000, remaining: 0, resetAt: now + 3600, windowSeconds: 3600 }; } } diff --git a/packages/malachite/src/utils/rate-limiter.ts b/packages/malachite/src/utils/rate-limiter.ts index 21e1e49..64047f1 100644 --- a/packages/malachite/src/utils/rate-limiter.ts +++ b/packages/malachite/src/utils/rate-limiter.ts @@ -714,7 +714,7 @@ export class RateLimiter { this.writeState({ limit: 5000, remaining: 0, - resetAt: now + 60, + resetAt: now + 3600, windowSeconds: 3600, updatedAt: now, headroomThreshold: this.headroomThreshold, diff --git a/packages/opal/src/publisher.ts b/packages/opal/src/publisher.ts index 22e84bd..2421b9c 100644 --- a/packages/opal/src/publisher.ts +++ b/packages/opal/src/publisher.ts @@ -19,7 +19,7 @@ import { } from '@ewanc26/croft-click-core'; const RECORD_TYPE = 'app.bsky.feed.post'; -const POINTS_PER_RECORD = 1; +const POINTS_PER_RECORD = 3; const MAX_BATCH_SIZE = 200; export interface PublishProgress { -- 2.51.2