You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix subscribed users incorrectly blocked by message limit
Three issues caused paid users to see "Message Limit Reached":
1. FREE_PLAN_MESSAGE_LIMIT was 0, so every fallback path (DB error,
missing subscription, wrong plan name) blocked all users immediately.
Changed to 10 to give free users a trial and prevent cascading failures.
2. Polar webhook stored raw product names (e.g. "Inti Computer - Starter")
as currentPlan instead of normalized slugs ("start"). The limit lookup
never matched, defaulting to the free limit. Added normalizePlanName()
to fuzzy-match product names to plan slugs.
3. getUserMessageUsage() error handler returned remainingMessages: 0,
silently blocking users on any DB error. Now fails open with 1 message
allowed so transient errors don't lock out paying customers.
Also created missing subscriptions/prompt_messages tables and seeded
subscription records for existing paid users in production DB.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments