From ddf2c0ab66a42bf5bc12a015aa79cb74005ffbd2 Mon Sep 17 00:00:00 2001 From: sanny-io Date: Tue, 3 Feb 2026 11:21:17 +0000 Subject: [PATCH 1/3] fix: cache the entire auth object --- packages/cache/src/plugin.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/cache/src/plugin.ts b/packages/cache/src/plugin.ts index 79ef3a6..7436368 100644 --- a/packages/cache/src/plugin.ts +++ b/packages/cache/src/plugin.ts @@ -61,15 +61,11 @@ export function defineCachePlugin(pluginOptions: CachePluginOptions) { let json: string if (client.$auth) { - const userId = Object.keys(client.$auth) - .filter(key => client.$schema.models[client.$schema.authType!]!.idFields.includes(key)) - .join('_') - json = stableHash({ args, model, operation, - userId, + auth: client.$auth, }) } else { json = stableHash({ From 017c8251f58d88948f9d83a5552cb5ed533f0afe Mon Sep 17 00:00:00 2001 From: sanny-io Date: Tue, 3 Feb 2026 11:22:06 +0000 Subject: [PATCH 2/3] chore: bump version --- package.json | 2 +- packages/cache/package.json | 2 +- packages/config/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c4fb4f7..357be23 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "workspace", "type": "module", - "version": "1.0.3", + "version": "1.0.4", "private": "true", "license": "MIT", "scripts": { diff --git a/packages/cache/package.json b/packages/cache/package.json index 819491f..eb24714 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@visualbravo/zenstack-cache", - "version": "1.0.3", + "version": "1.0.4", "keywords": [ "accelerate", "cache", diff --git a/packages/config/package.json b/packages/config/package.json index 23a6ce7..f10990d 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,7 +1,7 @@ { "name": "@zenstack-cache/config", "type": "module", - "version": "1.0.3", + "version": "1.0.4", "private": true, "exports": { "./ts": "./ts.json" From 72839b21b6bd7df5349286567a1c009d7101215b Mon Sep 17 00:00:00 2001 From: sanny-io Date: Tue, 3 Feb 2026 11:23:49 +0000 Subject: [PATCH 3/3] Simplify hash call. --- packages/cache/src/plugin.ts | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/cache/src/plugin.ts b/packages/cache/src/plugin.ts index 7436368..163fd0e 100644 --- a/packages/cache/src/plugin.ts +++ b/packages/cache/src/plugin.ts @@ -58,22 +58,12 @@ export function defineCachePlugin(pluginOptions: CachePluginOptions) { onQuery: async ({ args, model, operation, proceed, client }) => { if (args && 'cache' in args) { - let json: string - - if (client.$auth) { - json = stableHash({ - args, - model, - operation, - auth: client.$auth, - }) - } else { - json = stableHash({ - args, - model, - operation, - }) - } + const json = stableHash({ + args, + model, + operation, + auth: client.$auth, + }) if (!json) { throw new Error(