fix(silo): opening assembly does not pull linked part documents #337
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Opening a Silo assembly via any path other than Silo Pull opens the assembly document but does not download the linked part files it references. FreeCAD's PropertyXLink resolution then fails silently — the assembly opens with broken or missing links, and the parts are invisible.
Affected Code Paths
Dependency pulling (_pull_dependencies()) is only wired into the Silo_Pull command (silo_commands.py:1399-1410). All other entry points that open documents skip it entirely:
Root Cause
_sync.open_item() (silo_commands.py:634-646) either opens an existing local file or creates a new document from the database item metadata. It has no awareness of BOM/assembly dependencies:
When FreeCAD opens an assembly .FCStd, its PropertyXLink resolver looks for the linked documents on disk relative to the assembly file location. If those files were never pulled, the links fail and the parts don't appear.
Proposed Fix
Option A: Centralize dependency pulling in open_item()
Make open_item() BOM-aware — if the item is an assembly, call _pull_dependencies() before opening the document. This fixes all code paths at once since they all funnel through open_item() (or should).
Option B: Add a post-open hook that pulls missing dependencies
Register a slotOpenDocument observer that checks whether the opened document is a Silo-tracked assembly and pulls any missing BOM children before FreeCAD resolves links.
Recommendation
Option A is simpler and more predictable. It ensures dependencies are pulled before the document opens (matching the working Silo_Pull behavior). The direct FreeCAD.openDocument() calls in the activity pane and Silo_Open should also be routed through open_item() so they benefit from the centralized logic.
Additional Considerations
Fix implemented in silo-mod PR #51.
Changes:
_pull_dependencies()function downloads BOM children to canonical paths before openingopen_item()detects assemblies and calls_pull_dependencies()automaticallySilo_Openroutes throughopen_item()whenpart_numberis availableSilo_Pullpulls dependencies with progress dialog after main file downloadOnce the silo-mod PR is merged, the submodule pointer in this repo will be updated.