From 3d2cc4eb5b82d3b10347b925026478c29d1f6186 Mon Sep 17 00:00:00 2001 From: Arya Rizky Date: Sat, 16 May 2026 03:11:43 +0700 Subject: [PATCH] fix: remove erroneous len guard that broke multi globalAssetId filtering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lambda filter in the AAS repository had a guard condition `len(global_asset_ids) <= 1` that caused GET /shells?assetIds queries with 2+ globalAssetId parameters to silently return empty results. The guard evaluated False for every shell, short-circuiting the entire filter clause before the `in` membership check could run. Fix removes the guard — the `in` operator already handles zero, one, or many IDs correctly, matching the same pattern used for specific_asset_ids filtering above. Fixes #500 --- server/app/interfaces/repository.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/app/interfaces/repository.py b/server/app/interfaces/repository.py index 713023d0..3c0e2bb0 100644 --- a/server/app/interfaces/repository.py +++ b/server/app/interfaces/repository.py @@ -270,8 +270,7 @@ def _get_shells(self, request: Request) -> Tuple[Iterator[model.AssetAdministrat aas = filter(lambda shell: ( (not specific_asset_ids or all(specific_asset_id in shell.asset_information.specific_asset_id for specific_asset_id in specific_asset_ids)) and - (len(global_asset_ids) <= 1 and - (not global_asset_ids or shell.asset_information.global_asset_id in global_asset_ids)) + (not global_asset_ids or shell.asset_information.global_asset_id in global_asset_ids) ), aas) paginated_aas, end_index = self._get_slice(request, aas)