Fix twenty-server integration test on main (#14905)

Following https://github.com/twentyhq/twenty/pull/14869

Dynamically clearing the cache, as one entry was forgotten
It seems like a permission test deletes a role that's expected to be
existing in following tests, as now cache is getting invalidated tests
are failing

Seems to be related to
https://discord.com/channels/1130383047699738754/1423768505911869460

## Singleton local cache key collision
When set for the first time caches local keys looks like
`workspaceId:undefined", singleton is shared between several cache
instances
If the given key is undefined it will read on other entity cache entry.
This commit is contained in:
Paul Rastoin
2025-10-06 15:51:48 +02:00
committed by GitHub
parent db7fe8b327
commit b870ed238f
13 changed files with 183 additions and 191 deletions
@@ -98,6 +98,8 @@ export class WorkspaceQueryHookStorage {
wildcardInstances = wildcardPosthooksInstance;
}
return [...wildcardInstances, ...(this.postHookInstances.get(key) ?? [])];
const specificInstances = this.postHookInstances.get(key) ?? [];
return [...wildcardInstances, ...specificInstances];
}
}