fix: add includeVFS to initializeRoot() - prevents duplicate root creation

CRITICAL BUG FIX: VFS.initializeRoot() was calling brain.find() without
includeVFS: true, causing it to exclude VFS entities. This meant it could
never find an existing VFS root, and would create a new one on every init.

This directly caused the Workshop team's issue with ~10 duplicate roots!

All VFS internal methods that call brain.find() or brain.similar() now
correctly use includeVFS: true:
-  initializeRoot() (line 171) - JUST FIXED
-  search() (line 958)
-  findSimilar() (line 1009)
-  searchEntities() (line 2327)
This commit is contained in:
David Snelling 2025-10-24 12:31:42 -07:00
parent 0dda9dc56f
commit fbf26051b5

View file

@ -167,7 +167,8 @@ export class VirtualFileSystem implements IVirtualFileSystem {
path: '/', // ✅ Correct field name path: '/', // ✅ Correct field name
vfsType: 'directory' // ✅ Correct field name vfsType: 'directory' // ✅ Correct field name
}, },
limit: 10 limit: 10,
includeVFS: true // v4.4.0: CRITICAL - Must find VFS root entity!
}) })
if (existing.length > 0) { if (existing.length > 0) {