Skip to content

Commit 0035fc1

Browse files
authored
Fix rest metadata version missing (#16536)
## Context The REST pipeline re-fetches/sets the metadata version later in RestApiBaseHandler#getObjectMetadata by reading from DB and seeding the cache if it’s missing. That’s the place that actually needs it and already handles the “undefined” case. This also mirror the graphql path that was updated 3 weeks ago
1 parent 3e17140 commit 0035fc1

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

packages/twenty-server/src/engine/middlewares/middleware.service.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,6 @@ export class MiddlewareService {
106106
)
107107
: undefined;
108108

109-
if (metadataVersion === undefined && isDefined(data.workspace)) {
110-
await this.flatEntityMapsCacheService.invalidateFlatEntityMaps({
111-
workspaceId: data.workspace.id,
112-
flatMapsKeys: [
113-
'flatObjectMetadataMaps',
114-
'flatFieldMetadataMaps',
115-
'flatIndexMaps',
116-
],
117-
});
118-
throw new Error('Metadata cache version not found');
119-
}
120-
121109
const dataSourcesMetadata = data.workspace
122110
? await this.dataSourceService.getDataSourcesMetadataFromWorkspaceId(
123111
data.workspace.id,

0 commit comments

Comments
 (0)