https://sonarly.com/issue/41091?type=bug
A workspace-scoped request failed because the ORM metadata set for that workspace did not contain the required
Fix: Implemented a defensive fallback in `WorkspaceFlatWorkspaceMemberMapCacheService.computeForCache()` for the exact production failure mode:
- Wrapped the cache recomputation in a targeted `try/catch`.
- If the thrown error is `EntityMetadataNotFoundError`, the service now logs a warning and returns an empty `FlatWorkspaceMemberMaps` payload (`{ byId: {}, idByUserId: {} }`) instead of crashing the authenticated request path.
- Non-metadata errors are still rethrown unchanged.
This prevents user-facing 500s when a workspace runtime metadata set is missing `workspaceMember`, while keeping the behavior strict for unrelated failures.
Added tests:
- Returns empty maps when `EntityMetadataNotFoundError` occurs.
- Rethrows other unexpected errors.
Authored by Sonarly by autonomous analysis (run 46844).