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
This commit is contained in:
Weiko
2025-12-12 17:25:57 +01:00
committed by GitHub
parent 3e17140385
commit 0035fc1145
@@ -106,18 +106,6 @@ export class MiddlewareService {
)
: undefined;
if (metadataVersion === undefined && isDefined(data.workspace)) {
await this.flatEntityMapsCacheService.invalidateFlatEntityMaps({
workspaceId: data.workspace.id,
flatMapsKeys: [
'flatObjectMetadataMaps',
'flatFieldMetadataMaps',
'flatIndexMaps',
],
});
throw new Error('Metadata cache version not found');
}
const dataSourcesMetadata = data.workspace
? await this.dataSourceService.getDataSourcesMetadataFromWorkspaceId(
data.workspace.id,