[bug][collab] collab-token throttled by the anonymous public-share-AI limiter (5/min) → collaboration sync breaks after a few page opens #122
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: high
POST /api/auth/collab-tokenis rejected with 429 after only 5 requests per 60s, because the route skips only the AUTH throttler and is still subject to the anonymouspublic-share-ailimiter (limit 5/60s).Where:
apps/server/src/core/auth/auth.controller.ts:184—collabToken()is decorated only with@SkipThrottle({ [AUTH_THROTTLER]: true })(and the class skipsAI_CHAT). It does not skipPUBLIC_SHARE_AI_THROTTLER.apps/server/src/integrations/throttle/throttle.module.ts:32—{ name: PUBLIC_SHARE_AI_THROTTLER, ttl: 60_000, limit: 5 }(andPAGE_TEMPLATE30/60s) therefore also apply to collab-token. Effective cap = 5/min.Repro (live): open ~8–10 page editors within a minute as a normal logged-in user. From the 6th open onward:
The 429 carries the header
retry-after-public-share-ai, proving the anonymous public-share-AI bucket is the one rejecting it.Impact: a single real user who opens more than 5 pages per minute starves their own collab token. The body editor stays locally editable (edits go to Yjs/IndexedDB) so there is no visible error, but the collab WebSocket can no longer authenticate → edits don't sync to the server / other clients, and it triggers the uncaught
jwtDecode(undefined)crash (separate issue).Suggested fix: also
@SkipThrottlethePUBLIC_SHARE_AI(andPAGE_TEMPLATE) throttlers oncollab-token, or move it behind the per-user AUTH throttler only.Filed from an automated full-product QA pass on
develop@v0.93.0-64-gb60190ff, fresh DB. Each item below was reproduced live in a clean browser session unless noted.