fix: vfs node primary id not generated properly

This commit is contained in:
2025-11-30 19:20:08 +00:00
parent 1907cd83c8
commit a3110b67c3
2 changed files with 20 additions and 4 deletions

View File

@@ -125,7 +125,13 @@ func (vfs *VirtualFS) CreateFile(ctx context.Context, db bun.IDB, accountID uuid
return nil, err
}
id, err := newNodeID()
if err != nil {
return nil, err
}
node := Node{
ID: id,
PublicID: pid,
AccountID: accountID,
ParentID: opts.ParentID,
@@ -239,7 +245,13 @@ func (vfs *VirtualFS) CreateDirectory(ctx context.Context, db bun.IDB, accountID
return nil, err
}
id, err := newNodeID()
if err != nil {
return nil, err
}
node := Node{
ID: id,
PublicID: pid,
AccountID: accountID,
ParentID: parentID,