From 2e170c8c20f48847e6de8af117bb2bf4d7439575 Mon Sep 17 00:00:00 2001 From: Vaggelis Yfantis Date: Fri, 28 Nov 2025 14:57:46 +0200 Subject: [PATCH 1/4] fix(clerk-js): Remove the hydrate cache change for session --- packages/clerk-js/src/core/resources/Session.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/clerk-js/src/core/resources/Session.ts b/packages/clerk-js/src/core/resources/Session.ts index 7ac829ca520..ee5df2c43a1 100644 --- a/packages/clerk-js/src/core/resources/Session.ts +++ b/packages/clerk-js/src/core/resources/Session.ts @@ -131,15 +131,9 @@ export class Session extends BaseResource implements SessionResource { }; #hydrateCache = (token: TokenResource | null) => { - if (!token) { - return; - } - - const tokenId = this.#getCacheId(); - const existing = SessionTokenCache.get({ tokenId }); - if (!existing) { + if (token) { SessionTokenCache.set({ - tokenId, + tokenId: this.#getCacheId(), tokenResolver: Promise.resolve(token), }); } From eb042341d771adbb26bc95bc00b73027dab64c00 Mon Sep 17 00:00:00 2001 From: Vaggelis Yfantis Date: Fri, 28 Nov 2025 14:59:49 +0200 Subject: [PATCH 2/4] chore: Add changeset --- .changeset/two-candles-yawn.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/two-candles-yawn.md diff --git a/.changeset/two-candles-yawn.md b/.changeset/two-candles-yawn.md new file mode 100644 index 00000000000..ce7d278ed03 --- /dev/null +++ b/.changeset/two-candles-yawn.md @@ -0,0 +1,5 @@ +--- +'@clerk/clerk-js': patch +--- + +Reverts https://github.com/clerk/javascript/pull/7105 From 6c714292572e48f77e9fdf8e0b8d5fb537ddfdd2 Mon Sep 17 00:00:00 2001 From: Vaggelis Yfantis Date: Fri, 28 Nov 2025 15:01:50 +0200 Subject: [PATCH 3/4] chore: Update changeset --- .changeset/two-candles-yawn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/two-candles-yawn.md b/.changeset/two-candles-yawn.md index ce7d278ed03..17eda18e2db 100644 --- a/.changeset/two-candles-yawn.md +++ b/.changeset/two-candles-yawn.md @@ -2,4 +2,4 @@ '@clerk/clerk-js': patch --- -Reverts https://github.com/clerk/javascript/pull/7105 +Reverts the changes done https://github.com/clerk/javascript/pull/7105, as it was causing JWT's returned from client piggybacking not get inserted into cache even though their claims have actually changed From ea63e5076116ee4f86d5e34bf4376408f49dc68d Mon Sep 17 00:00:00 2001 From: Vaggelis Yfantis Date: Fri, 28 Nov 2025 15:06:57 +0200 Subject: [PATCH 4/4] Update changset Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .changeset/two-candles-yawn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/two-candles-yawn.md b/.changeset/two-candles-yawn.md index 17eda18e2db..059354f9066 100644 --- a/.changeset/two-candles-yawn.md +++ b/.changeset/two-candles-yawn.md @@ -2,4 +2,4 @@ '@clerk/clerk-js': patch --- -Reverts the changes done https://github.com/clerk/javascript/pull/7105, as it was causing JWT's returned from client piggybacking not get inserted into cache even though their claims have actually changed +Reverts the changes introduced in [PR #7105](https://github.com/clerk/javascript/pull/7105), as it was causing JWTs returned from client piggybacking not to be inserted into the cache even though their claims had actually changed.