fix: update path when renaming during save_account

We do update the path of all child directories by calling
filesystem.update_child_paths(), but this was never done for the user's
actual home directory itself (only everything under it).

The most ideal solution would be to delegate this behavior to the move
operation instead of updating the fsentries table directly, but making
this change right now has a high risk of breaking changes since this the
behavior in this file is very old.
This commit is contained in:
KernelDeimos
2025-09-26 18:44:32 -04:00
parent fae33301a8
commit 088ff4d696
+2 -1
View File
@@ -160,10 +160,11 @@ router.post('/save_account', auth, express.json(), async (req, res, next)=>{
// Update root directory name
await db.write(
`UPDATE fsentries SET name = ? WHERE user_id = ? and parent_uid IS NULL`,
`UPDATE fsentries SET name = ?, path = ? WHERE user_id = ? and parent_uid IS NULL`,
[
// name
req.body.username,
'/' + req.body.username,
// id
req.user.id,
]