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
{{ message }}
Repository navigation
javascript Bug: Error state expiration check is inverted, preventing SDK recovery after 10 minutes #7190
The error state expiration logic in packages/js-core/src/lib/common/setup.ts has an inverted condition. When an error occurs, the SDK sets a 10-minute expiration time, but:
Within 10 minutes: SDK retries initialization (should skip to reduce server load)
After 10 minutes: SDK permanently skips initialization (should retry to recover)
This means once 10 minutes pass, the SDK never recovers unless users manually clear localStorage.
Test Results:
Within 10 minutes:
🧱 Formbricks - Error state is expired. Continuing with initialization.
After 10 minutes:
🧱 Formbricks - Error state is not expired, skipping initialization.
The condition and log messages are completely inverted.
Expected Behavior
Within 10 minutes of error:
Skip initialization to avoid overwhelming the server
Log: "Error state is not expired, skipping initialization"
After 10 minutes:
Retry initialization to attempt recovery
Log: "Error state is expired. Continuing with initialization"
Other information (incl. screenshots, Formbricks version, steps to reproduce,...)
Current behavior (inverted):
Within 10 minutes:
Retries initialization (creates unnecessary server load)
Logs: "Error state is expired. Continuing with initialization."
After 10 minutes:
Permanently skips initialization (SDK never recovers)
Logs: "Error state is not expired, skipping initialization"
if(expiresAt&&isNowExpired(newDate(expiresAt))){// When isNowExpired returns true (expired), it skips - INVERTED!console.error("🧱 Formbricks - Error state is not expired, skipping initialization");returnokVoid();}console.error("🧱 Formbricks - Error state is expired. Continuing with initialization.");
### YourEnvironmentSelf-hostedFormbricks
Activity
fix(js-core): invert expiration logic for SDK error state (formbricks…
fix(js-core): invert expiration logic for SDK error state (formbricks…
bharathkumar39293 commentedon Feb 4, 2026
I’ve opened a PR that fixes the inverted expiration logic and adds test coverage: #7202
Happy to adjust if anything needs tweaking. @jobenjada
fix(js-core): invert expiration logic for SDK error state (#7190) (#7202
fix(js-core): invert expiration logic for SDK error state (formbricks…