Repository navigation
Conversation
WalkthroughThe changes modify the initialization logic in 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Important Action Needed: IP Allowlist UpdateIf your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:
Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
fcf52c2 to
1c97ab3
Compare
|
@mattinannt 👋 Tests are updated and passing, and I’ve manually verified the behavior. |
…fix/7190-sdk-error-state-inversion
Dhruwang
left a comment
There was a problem hiding this comment.
Thanks for the PR, looks good ! 🚀
This PR fixes an inverted error backoff check in the JS SDK that prevented recovery after the 10-minute cooldown period.
Problem
The SDK was retrying initialization during the active error backoff window and permanently skipping initialization once the window expired. This caused the SDK to never recover unless users manually cleared localStorage.
Fix
Corrected the expiration check in setup.ts so that:
Initialization is skipped while the error state is active (not expired)
Initialization is retried once the error state expires
Updated console log messages to reflect the corrected behavior
Tests
Updated existing test to verify setup is skipped when the error state is active
Added a test to verify setup continues once the error state is expired
Verification
Unit tests passed:
pnpm turbo run test --filter=@formbricks/js-core
Manually verified via localStorage timestamp manipulation as described in #7190
This restores the intended backoff + recovery behavior without any API or storage changes.