mirror of
https://github.com/Comfy-Org/desktop.git
synced 2026-11-04 23:47:43 +00:00
[GH-ISSUE #1404] OneDrive detection and default path handling misses common variants #401
Labels
No labels
area: desktop-app
Bounty
bug
bug-cop:answered
bug-cop:response-received
component: installer
component: preload
custom node
dependencies
Design
documentation
duplicate
enhancement
expected
frontend
good first issue
installation
Low-Priority
performance
Planned
platform: cross-platform
platform: windows
Potential Bug
Potential Bug
pull-request
question
refactor
Release
stale
User Support
V1
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/desktop#401
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
Originally created by @benceruleanlu on GitHub (Nov 19, 2025).
Original GitHub issue: https://github.com/Comfy-Org/desktop/issues/1404
Summary
Path validation and default install path selection contain special handling for OneDrive, but the current implementation only covers a narrow set of cases:
buildRestrictedPaths()only usesprocess.env.OneDrive.GET_SYSTEM_PATHSstrips a hardcoded"OneDrive\\"substring from the documents path.This can miss other common OneDrive variants and folders, leading to:
Current behavior
In
src/handlers/pathHandlers.ts:and in
GET_SYSTEM_PATHS:Issues / edge cases
OneDrive variants not covered
OneDriveCommercial,OneDriveConsumer, or path shapes such asC:\Users\<user>\OneDrive - <Tenant>\Documents.process.env.OneDriveexactly or the simple/OneDrive\\/regex indocumentsPath.replace, so:evaluatePathRestrictionsmay not mark the path asisOneDrivewhen the env var doesn’t align with the actual path.Default path sanitization is brittle
documentsPath.replace(/OneDrive\\/, '')assumes a specific segment name (OneDrive\) and doesn’t consider spaces or suffixes.C:\Users\User\OneDrive - Work\Documents, the OneDrive segment is not removed and the default still lives on OneDrive.Expected behavior
OneDrive,OneDrive - Personal,OneDrive - <Tenant>, or similar, should be treated asisOneDriveand blocked for installation (as the UI text already suggests).GET_SYSTEM_PATHSon Windows should avoid landing under any OneDrive location when possible.Possible improvements
More robust OneDrive root detection
OneDrive,OneDriveCommercial,OneDriveConsumer, etc.) and adding each tobuildRestrictedPaths."OneDrive") when normalizing Windows paths.Safer default documents path
OneDrive*segment plus any following tenant suffix (e.g."OneDrive - Work").C:\Users\<user>\Documentswhen the currentdocumentspath appears to be under OneDrive.Tests for OneDrive variants
tests/unit/handlers/pathHandler.test.tswith cases for:documentspaths likeC:\Users\Test\OneDrive - Tenant\Documents.OneDriveCommercial/OneDriveConsumerwith corresponding paths.GET_SYSTEM_PATHSreturns a default install path outside of any OneDrive subtree.VALIDATE_INSTALL_PATHreturnsisOneDrive: trueandisValid: falsefor these scenarios.Impact
Suggested work
buildRestrictedPathsandGET_SYSTEM_PATHSto use that strategy.┆Issue is synchronized with this Notion page by Unito
@dosubot[bot] commented on GitHub (Feb 18, 2026):
Hi, @benceruleanlu. I'm Dosu, and I'm helping the desktop team manage their backlog and am marking this issue as stale.
Issue Summary:
Next Steps:
Thanks for your understanding and contribution!