From cd03dd4fdd82ec7d4ed0434525806b3411c9283a Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Mon, 7 Jul 2025 23:54:14 +0000 Subject: [PATCH] Fix duplication not handling update messages properly --- hippolyzer/lib/client/inventory_manager.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hippolyzer/lib/client/inventory_manager.py b/hippolyzer/lib/client/inventory_manager.py index ac7642b..09395cf 100644 --- a/hippolyzer/lib/client/inventory_manager.py +++ b/hippolyzer/lib/client/inventory_manager.py @@ -365,7 +365,13 @@ class InventoryManager: ) )) msg = await asyncio.wait_for(get_msg(), 5.0) - return self.model.get(msg["ItemData"]["ItemID"]) # type: ignore + # BulkInventoryUpdate message may not have already been handled internally, do it manually. + self._handle_bulk_update_inventory(msg) + + # Now pull the item out of the inventory + new_item = self.model.get(msg["ItemData"]["ItemID"]) + assert new_item is not None + return new_item # type: ignore elif isinstance(node, InventoryCategory): # Keep a list of the original descendents in case we're copy a folder within itself to_copy = list(node.descendents) @@ -385,7 +391,7 @@ class InventoryManager: await self.copy(node, new_parent, contents=False) return new_cat else: - assert False + raise ValueError(f"Unknown node type: {node!r}") async def update(self, node: InventoryNodeBase, data: dict) -> None: path = f"/category/{node.node_id}"