Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Google Drive doesn't show in Cloud Drives when mounts as a folder #15698

Closed
kohyung opened this issue Jun 26, 2024 · 13 comments
Closed

Bug: Google Drive doesn't show in Cloud Drives when mounts as a folder #15698

kohyung opened this issue Jun 26, 2024 · 13 comments
Labels
area - cloud drives Features or bug reports relating to cloud drives good first issue Good issue for new contributors to get started with

Comments

@kohyung
Copy link

kohyung commented Jun 26, 2024

Description

Google Drive didn't show up in Cloud Drives Sidebar, Dropbox & Onedrive got no problem.
screenshot-1719384747145

Steps To Reproduce

Just new install already like that.
screenshot-1719384747145

Requirements

New installation already like that.
screenshot-1719384747145

Files Version

3.5.0.0

Windows Version

10.0.19045.4529

Log File

debug.log

@kohyung kohyung added the bug label Jun 26, 2024
@0x5bfa 0x5bfa added the area - cloud drives Features or bug reports relating to cloud drives label Jun 26, 2024
@Josh65-2201
Copy link
Member

Thanks for the report. Have you set up the desktop client, opened it and restarted Files from the system tray?

@Josh65-2201 Josh65-2201 added the needs - additional info Needs more information from the reporter label Jun 26, 2024
@kohyung
Copy link
Author

kohyung commented Jun 26, 2024 via email

@Josh65-2201
Copy link
Member

Email attachments don't work. You will have to click the View on GitHub link at the bottom of the email > Copy and paste or click the add attachment button to select the file > Wait until you don't see uploading in the text > Click the green comment button.

@kohyung
Copy link
Author

kohyung commented Jun 26, 2024

Hi, pls refer to the attachment, I have tried a few times.
screenshot-1719404309390

@Josh65-2201
Copy link
Member

Can you send a screenshot of the full Windows File Explorer window on This PC

@kohyung
Copy link
Author

kohyung commented Jun 26, 2024

Screenshot 2024-06-26 22 33 00

@Josh65-2201
Copy link
Member

Need a screenshot from Windows File Explorer, not Files.

@kohyung
Copy link
Author

kohyung commented Jun 26, 2024

Screenshot 2024-06-26 22 37 44

@hez2010
Copy link
Member

hez2010 commented Jun 27, 2024

We don't support Google Drive mounting as a folder instead of a dedicate drive currently.

@Josh65-2201 To detect the mounting point of Google Drive properly, we need to inspect the value of PerAccountPreferences in HKEY_CURRENT_USER\Software\Google\DriveFS from the Windows Registry.

Marking it as a good first issue as the fix should be trivial:

  1. Read the value of PerAccountPreferences from HKEY_CURRENT_USER\Software\Google\DriveFS
  2. Parse the value as json
  3. Read per_account_preferences as an array and add all items in to the sidebar, the path to Google Drive is saved in mount_point_path

/cc: @yaira2

@hez2010 hez2010 added good first issue Good issue for new contributors to get started with and removed needs - additional info Needs more information from the reporter labels Jun 27, 2024
@Josh65-2201 Josh65-2201 changed the title Google Drive didn't show up in Cloud Drives Sidebar Bug: Google Drive doesn't show in Cloud Drives when mounts as a folder Jun 27, 2024
@yaira2 yaira2 moved this from 🆕 New to 🔖 Ready to build in Files task board Jun 28, 2024
@wharvex
Copy link
Contributor

wharvex commented Jul 2, 2024

Hello, I would like to try to work on this if that is okay. I think I found the place in the source code where I would need to make changes, and I plan to start working on it tomorrow. I am aware of the contributing guidelines and will follow them.

@yaira2
Copy link
Member

yaira2 commented Jul 2, 2024

Thank you! Please reach out if you have any questions.

wharvex added a commit to wharvex/WinUiTest that referenced this issue Jul 4, 2024
Files.App.Utils.Cloud.GoogleDriveCloudDetector.GetProviders()

currently does, and what we want it to do.

In Files.App.Utils.Cloud.GoogleDriveCloudDetector.GetProviders(), first we get a
Sqlite database file at the following path:

"$($env:localappdata)/Google/DriveFS/root_preference_sqlite.db"

Then we copy that database to a temporary folder.

Then we run the following SQL queries against the copy:

SELECT * FROM roots

SELECT * FROM media WHERE fs_type=10

Then we traverse the ITEMs in each of the two response sets and create a new
GoogleDrive-type CloudProvider for each ITEM, with the CloudProvider.SyncFolder
property set to a (formatted) part of each ITEM's contents.

So far, in this scratch repo, I have confirmed that when Google Drive is mounted
as a folder, this Sqlite method for getting the mount paths DOESN'T work.

"When Google Drive is mounted as a folder" means when you have the "Google Drive
streaming location" setting set to "Folder" in Google Drive Preferences.

I have also confirmed that when Google Drive is mounted as a folder, the
registry method for getting the mount paths

( described here:
files-community/Files#15698 (comment) )

DOES work.

Next I will test the behavior of each method when Google Drive is mounted as a
dedicated drive.
@wharvex
Copy link
Contributor

wharvex commented Jul 4, 2024

No problem! I made some progress on exploring the problem today (see the notification above about the commit I just made in a scratch repo that references this issue), and I'm hoping to submit a pull request sometime this weekend.

@Josh65-2201 Josh65-2201 moved this from 🔖 Ready to build to 🏗 In progress in Files task board Jul 7, 2024
@yaira2
Copy link
Member

yaira2 commented Aug 14, 2024

@kohyung we've resolved the issue in our development branch, and it will be included in the next update. Huge shoutout to @wharvex for contributing this fix.

@yaira2 yaira2 closed this as completed Aug 14, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Files task board Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area - cloud drives Features or bug reports relating to cloud drives good first issue Good issue for new contributors to get started with
Projects
Archived in project
Development

No branches or pull requests

6 participants