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:
+1
-2
@@ -28,6 +28,7 @@ import { workspaceQueryRunnerGraphqlApiExceptionHandler } from 'src/engine/api/g
|
||||
import { WorkspaceQueryHookService } from 'src/engine/api/graphql/workspace-query-runner/workspace-query-hook/workspace-query-hook.service';
|
||||
import { ApiKeyRoleService } from 'src/engine/core-modules/api-key/api-key-role.service';
|
||||
import { FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
||||
import { WorkspaceNotFoundDefaultError } from 'src/engine/core-modules/workspace/workspace.exception';
|
||||
import { type PermissionFlagType } from 'src/engine/metadata-modules/permissions/constants/permission-flag-type.constants';
|
||||
import {
|
||||
PermissionsException,
|
||||
@@ -39,7 +40,6 @@ import { UserRoleService } from 'src/engine/metadata-modules/user-role/user-role
|
||||
import { type WorkspaceDataSource } from 'src/engine/twenty-orm/datasource/workspace.datasource';
|
||||
import { type WorkspaceRepository } from 'src/engine/twenty-orm/repository/workspace.repository';
|
||||
import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';
|
||||
import { WorkspaceNotFoundDefaultError } from 'src/engine/core-modules/workspace/workspace.exception';
|
||||
|
||||
export type GraphqlQueryResolverExecutionArgs<Input extends ResolverArgs> = {
|
||||
args: Input;
|
||||
@@ -185,7 +185,6 @@ export abstract class GraphqlQueryBaseResolverService<
|
||||
roleId,
|
||||
shouldBypassPermissionChecks,
|
||||
};
|
||||
|
||||
const results = await this.resolve(
|
||||
graphqlQueryResolverExecutionArgs,
|
||||
featureFlagsMap,
|
||||
|
||||
+3
-1
@@ -77,12 +77,14 @@ export class GraphqlQueryDeleteOneResolverService extends GraphqlQueryBaseResolv
|
||||
const typeORMObjectRecordsParser =
|
||||
new ObjectRecordsToGraphqlConnectionHelper(objectMetadataMaps);
|
||||
|
||||
return typeORMObjectRecordsParser.processRecord({
|
||||
const result = typeORMObjectRecordsParser.processRecord({
|
||||
objectRecord: deletedRecord,
|
||||
objectName: objectMetadataItemWithFieldMaps.nameSingular,
|
||||
take: 1,
|
||||
totalCount: 1,
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async validate(
|
||||
|
||||
+3
-1
@@ -98,6 +98,8 @@ export class WorkspaceQueryHookStorage {
|
||||
wildcardInstances = wildcardPosthooksInstance;
|
||||
}
|
||||
|
||||
return [...wildcardInstances, ...(this.postHookInstances.get(key) ?? [])];
|
||||
const specificInstances = this.postHookInstances.get(key) ?? [];
|
||||
|
||||
return [...wildcardInstances, ...specificInstances];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user