We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf4a9a3 commit 80d9830Copy full SHA for 80d9830
packages/clerk-js/src/core/auth/SessionCookiePoller.ts
@@ -1,5 +1,7 @@
1
import { createWorkerTimers } from '@clerk/shared/workerTimers';
2
3
+import { debugLogger } from '@/utils/debug';
4
+
5
const INTERVAL_IN_MS = 5 * 1_000;
6
7
/**
@@ -21,8 +23,13 @@ export class SessionCookiePoller {
21
23
22
24
const run = async () => {
25
this.initiated = true;
- await cb();
- this.timerId = this.workerTimers.setTimeout(run, INTERVAL_IN_MS);
26
+ try {
27
+ await cb();
28
+ } catch (error) {
29
+ debugLogger.error('SessionCookiePoller callback failed', { error }, 'auth');
30
+ } finally {
31
+ this.timerId = this.workerTimers.setTimeout(run, INTERVAL_IN_MS);
32
+ }
33
};
34
35
void run();
0 commit comments