files-community / Files

Building the best file manager for Windows
https://files.community
MIT License
34.15k stars 2.18k forks source link

Bug: OneDrive folder isn't loading the correct location #13680

Open fubaWoW opened 11 months ago

fubaWoW commented 11 months ago

Description

If the Folder of Microsoft OneDrive is set to a different Location and is NOT set to the Default Location (C:\Users\%username%\OneDrive) an error pops when click the "OneDrive" folder in your "Cloud Drives" Section!

image

Steps To Reproduce

See Description and Screenshot!

Requirements

See Description and Screenshot!

Files Version

3.0

Windows Version

Windows 11 Build 22621.2428

Log File

not needed

yaira2 commented 11 months ago

Can you upload the log file?

fubaWoW commented 11 months ago

Can you upload the log file?

i can, logfile here: debug.log

but now... im very interested to hear what the log file change... because it just say NOTHING

anyway... the "proper" way to get the OneDrive folder is not to set it "hardcoded" as it is, because it is stored in the Windows Registry! HKEY_CURRENT_USER\Software\Microsoft\OneDrive with the Value UserFolder

Josh65-2201 commented 11 months ago

The reason we ask for the log is because we don't know what it says and might include useful information to help fix the issue. The OneDrive folder also isn't hardcoded.

yaira2 commented 11 months ago

Thank you for uploading the log file, we indeed use the Registry to fetch location. We'll have to take a closer look to see why it's not working for you. Alternatively, if you're interested in debugging this from you side, the relevant code is in CloudDrivesDetector.cs line 152.

fubaWoW commented 11 months ago

ah i see my Registry (for whatever reason) contains 2 Accounts... maybe because of Office 365 -> don't know?

one (the first) is called Business1 what contains C:\Users\fuba\OneDrive

image

and Personal what contains my actual UserFolder F:\OneDrive is not get listed image

But your code looks correct as of you enum all subkeys... and that way both Locations should be added to your Cloud Drives Section i guess? very confusing!

maybe you can add a little debug code to write the contents of the list oneDriveAccounts to the debug file? maybe i can try it by myself later but im sure you know your code better ^^

yaira2 commented 11 months ago

This might be related to #4966.

fubaWoW commented 11 months ago

Yeah looks like that is the Problem! But why enum all possible accounts into a list if only the first one can be displayed? 😕 This can cause performance issues in worst case i guess.

Anyway.... I've removed the Business1 as a workaround for now and the Personal OneDrive is now the only one in Files.

yaira2 commented 11 months ago

I think there is supposed to be support for multiple accounts, @gave92 do you know what's going on here?