Remove legacy FindAllViews response cache flush from migration runner (#23190)

The pattern-flush (a full Redis keyspace SCAN) was kept for exactly one
release after the metadata GraphQL caches were re-keyed on flat-map
hashes (#23164), as the only invalidation signal for old pods'
version-keyed FindAllViews entries during rolling deploys. With all pods
on hash-keyed caches, dependency-hash rotation in the cache key covers
both view and metadata changes, so the flush is redundant.

flushGraphQLOperation has no remaining callers, so it is deleted from
WorkspaceCacheStorageService as well. incrementMetadataVersion stays: it
still feeds the X-Schema-Version check.

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/23190?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Weiko
2026-07-23 14:28:07 +02:00
committed by GitHub
parent 15f571837e
commit 8368dd41c4
2 changed files with 0 additions and 37 deletions
@@ -154,18 +154,6 @@ export class WorkspaceCacheStorageService {
);
}
async flushGraphQLOperation({
operationName,
workspaceId,
}: {
operationName: string;
workspaceId: string;
}): Promise<void> {
await this.cacheStorageService.flushByPattern(
`${WORKSPACE_CACHE_KEYS.GraphQLOperations}:${operationName}:${workspaceId}:*`,
);
}
async flushHashKeyedWorkspaceCache(workspaceId: string): Promise<void> {
await Promise.all(
Object.values(HASH_KEYED_WORKSPACE_CACHE_KEYS).map((key) =>
@@ -15,9 +15,7 @@ import { getMetadataRelatedMetadataNamesForValidation } from 'src/engine/metadat
import { getMetadataRelatedMetadataNames } from 'src/engine/metadata-modules/flat-entity/utils/get-metadata-related-metadata-names.util';
import { getMetadataSerializedRelationNames } from 'src/engine/metadata-modules/flat-entity/utils/get-metadata-serialized-relation-names.util';
import { createSearchFieldMetadatasByTsVectorFieldIdAccessor } from 'src/engine/metadata-modules/flat-search-field-metadata/utils/create-search-field-metadatas-by-ts-vector-field-id-accessor.util';
import { FIND_ALL_VIEWS_GRAPHQL_OPERATION } from 'src/engine/metadata-modules/view/constants/find-all-views-graphql-operation.constant';
import { WorkspaceMetadataVersionService } from 'src/engine/metadata-modules/workspace-metadata-version/services/workspace-metadata-version.service';
import { WorkspaceCacheStorageService } from 'src/engine/workspace-cache-storage/workspace-cache-storage.service';
import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
import { WorkspaceMigration } from 'src/engine/workspace-manager/workspace-migration/workspace-migration-builder/types/workspace-migration.type';
import {
@@ -37,7 +35,6 @@ export class WorkspaceMigrationRunnerService {
private readonly coreDataSource: DataSource,
private readonly workspaceMigrationRunnerActionHandlerRegistry: WorkspaceMigrationRunnerActionHandlerRegistryService,
private readonly workspaceMetadataVersionService: WorkspaceMetadataVersionService,
private readonly workspaceCacheStorageService: WorkspaceCacheStorageService,
private readonly workspaceCacheService: WorkspaceCacheService,
private readonly logger: LoggerService,
private readonly twentyConfigService: TwentyConfigService,
@@ -65,28 +62,6 @@ export class WorkspaceMigrationRunnerService {
);
}
const viewRelatedFlatMapsKeys: (keyof AllFlatEntityMaps)[] = [
'flatViewMaps',
'flatViewFilterMaps',
'flatViewGroupMaps',
'flatViewFieldMaps',
'flatViewFilterGroupMaps',
];
const shouldInvalidateFindViewsGraphqlCacheOperation =
viewRelatedFlatMapsKeys.some((key) => flatMapsKeysSet.has(key));
if (
shouldInvalidateFindViewsGraphqlCacheOperation ||
shouldIncrementMetadataGraphqlSchemaVersion
) {
asyncOperations.push(
this.workspaceCacheStorageService.flushGraphQLOperation({
operationName: FIND_ALL_VIEWS_GRAPHQL_OPERATION,
workspaceId,
}),
);
}
const shouldInvalidateRoleMapCache =
flatMapsKeysSet.has('flatRoleMaps') ||
flatMapsKeysSet.has('flatRoleTargetMaps');