fixes for scenes framework (#1822)

* removed scenes object from caching hash

* update backend deps
This commit is contained in:
Sriram
2024-04-29 11:45:10 +01:00
committed by GitHub
parent 26096e7f32
commit 3ebc05d242
4 changed files with 44 additions and 40 deletions

View File

@@ -100,9 +100,18 @@ function cacheRequest(func, funcName, funcScope, self) {
};
}
//TODO: add type for the args
function getRequestHash(args) {
const argsJson = JSON.stringify(args);
return getHash(argsJson);
try {
if (typeof args === 'object') {
args = Array.from(args || {}).filter((arg: any) => !Boolean(arg?.scopedVars?.__sceneObject));
}
const argsJson = JSON.stringify(args);
return getHash(argsJson);
} catch (ex) {
console.error(`failing to get the request hash for caching. type of args ${typeof args}`);
return getHash(crypto.randomUUID());
}
}
function getHash(str: string): number {