Skip to content

Commit 40842e6

Browse files
committed
revert: undo debugLogger commit pushed to wrong branch
1 parent ff308af commit 40842e6

3 files changed

Lines changed: 4 additions & 38 deletions

File tree

packages/clerk-js/src/core/auth/AuthCookieService.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,6 @@ export class AuthCookieService {
177177
return;
178178
}
179179

180-
const sessions = (this.clerk.client as any)?.sessions;
181-
if (sessions?.length > 1 && token) {
182-
debugLogger.info(
183-
'Updating session cookie (multi-session client)',
184-
{ activeSessionId: this.clerk.session?.id, sessionCount: sessions.length, hasActor: !!this.clerk.session?.actor },
185-
'authCookieService',
186-
);
187-
}
188-
189180
if (!token && !isValidBrowserOnline()) {
190181
debugLogger.warn('Removing session cookie (offline)', { sessionId: this.clerk.session?.id }, 'authCookieService');
191182
}
@@ -214,23 +205,17 @@ export class AuthCookieService {
214205

215206
//sign user out if a 4XX error
216207
if (is4xxError(e)) {
217-
debugLogger.warn(
218-
'Token fetch failed with 4xx, triggering unauthenticated flow',
219-
{ errorCode: isClerkAPIResponseError(e) ? e.errors[0]?.code : undefined, sessionId: this.clerk.session?.id },
220-
'authCookieService',
221-
);
222208
void this.clerk.handleUnauthenticated().catch(noop);
223209
return;
224210
}
225211

226212
// The poller failed to fetch a fresh session token, update status to `degraded`.
227213
this.clerkEventBus.emit(clerkEvents.Status, 'degraded');
228214

229-
debugLogger.warn(
230-
'Token fetch failed, status degraded',
231-
{ error: e?.message || String(e), sessionId: this.clerk.session?.id },
232-
'authCookieService',
233-
);
215+
// --------
216+
// Treat any other error as a noop
217+
// TODO(debug-logs): Once debug logs is available log this error.
218+
// --------
234219
}
235220

236221
private handleSignOut() {

packages/clerk-js/src/core/clerk.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,16 +2347,6 @@ export class Clerk implements ClerkInterface {
23472347
if (!this.client || !this.session) {
23482348
return;
23492349
}
2350-
debugLogger.warn(
2351-
'handleUnauthenticated triggered',
2352-
{
2353-
activeSessionId: this.session.id,
2354-
hasActor: !!this.session.actor,
2355-
totalSessions: this.client.sessions.length,
2356-
signedInSessions: this.client.signedInSessions.map(s => ({ id: s.id, hasActor: !!s.actor })),
2357-
},
2358-
'clerk',
2359-
);
23602350
try {
23612351
const newClient = await Client.getOrCreateInstance().fetch();
23622352
this.updateClient(newClient);

packages/clerk-js/src/core/resources/Session.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,6 @@ export class Session extends BaseResource implements SessionResource {
413413
SessionTokenCache.set({ tokenId, tokenResolver });
414414

415415
return tokenResolver.then(token => {
416-
const returnedSid = token.jwt?.claims?.sid;
417-
if (returnedSid && returnedSid !== this.id) {
418-
debugLogger.warn(
419-
'Token session mismatch: requested token for one session but received token for another',
420-
{ requestedSessionId: this.id, returnedSessionId: returnedSid, tokenId, hasActor: !!this.actor },
421-
'session',
422-
);
423-
}
424-
425416
if (shouldDispatchTokenUpdate) {
426417
eventBus.emit(events.TokenUpdate, { token });
427418

0 commit comments

Comments
 (0)