-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix: Fixed issues with Google Drive support #16706
Conversation
I'll complete the bug fix tests within the next few days and update the PR with the results. |
Thank you @Lamparter for the review! I just committed all the changes and will rebase onto main soon. |
Address the following issue: files-community#16149 Avoid skipping detection of a drive named G that is not Google Drive when the registry contains old keys for Google Drive. Add "My Drive" to the Google Drive registry path in RemovableDrivesService and check if it's valid. Then DON'T skip the found "G" drive if the "My Drive" path is NOT valid.
Different approach to addressing the following issue: files-community#16149 Use DriveHelpers.GetExtendedDriveLabel to safely get the VolumeLabel of each DriveInfo object that RemovableDrivesService looks at. Then use this to filter out GoogleDrive drives from appearing in a plain "Drives" section, while still (hopefully) allowing drives named "G" to appear in such a section. Next I will test this by renaming my Google Drive drive to something other than G, and then making a new drive that is not Google Drive and naming it "G", and then running the program to see if it detects the non-Google Drive "G" drive. next: testing
Move Registry query for the base Google Drive path from `StorageDevicesService` back into `GoogleDriveCloudDetector` because we can use the drive label to filter GD out of the plain "Drives" sections (we were using the base GD path). Comments and logging adjustments. next: test on all the mirror/stream-letter/folder configs
StorageDevicesService Fix spacing of concatenated string that somehow got changed. GoogleDriveCloudDetector Change back to early yield break at end of `GetProviders` to reduce nesting. GoogleDriveCloudDetector Change `AddMyDriveToPathAndValidate` back to private. GoogleDriveCloudDetector Remove call stack logging from `AddMyDriveToPathAndValidate`.
Provide link to advanced Google Drive for desktop settings reference in summary comment above `GoogleDriveCloudDetector.GetRegistryBasePath`.
Co-authored-by: Lamparter <[email protected]> Signed-off-by: Tim <[email protected]>
Co-authored-by: Lamparter <[email protected]> Signed-off-by: Tim <[email protected]>
Co-authored-by: Lamparter <[email protected]> Signed-off-by: Tim <[email protected]>
d22dbea
to
fec01df
Compare
Updated bugfix test plan with the first one completed:
|
Unfortunately I was unable to reproduce @KremmenUK's issue via the method described in my test plan. My plan was to plug in a USB drive, set its drive letter to G, stop Google Drive while it was on the Performing these setup tasks did result in the non-Google-Drive G drive being filtered out by the if-statement in However, they did not prevent my non-Google-Drive G drive from appearing in the plain "Drives" sections. So even though that if-statement passed, Files still managed to find my USB Drive and display it, unlike with @KremmenUK's dashcam drive. Here is a screen recording of the test I did. I will keep trying to figure the issue out, but if anyone has any suggestions please let me know. |
|
Thanks for continuing to look
As I replied a while ago, I fixed the problem via one of the suggested
fixes which involved removing the link to my obsolete G: [Google drive] and
it's not recurred since
Pete
…On Mon, 20 Jan 2025, 02:29 Tim, ***@***.***> wrote:
Unfortunately I was unable to reproduce @KremmenUK
<https://github.com/KremmenUK>'s issue via the method described in my
test plan.
My plan was to plug in a USB drive, set its drive letter to G, stop Google
Drive while it was on the G:\ mount point, and run Files.
Performing these setup tasks *did* result in the non-Google-Drive G drive
being filtered out by the if-statement in StorageDevicesService which we
thought was the culprit.
However, they *did not* prevent my non-Google-Drive G drive from
appearing in the plain "Drives" sections.
So even though that if-statement passed, Files still managed to find my
USB Drive and display it, unlike with @KremmenUK
<https://github.com/KremmenUK>'s dashcam drive.
Here
<https://drive.google.com/file/d/1DCvxHC-tDeIgoUYg97jIpYMaY9eRc7L6/view?usp=sharing>
is a screen recording of the test I did. I will keep trying to figure the
issue out, but if anyone has any suggestions please let me know.
—
Reply to this email directly, view it on GitHub
<#16706 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BLDQFKCWHFQ25KQU3KTJKBL2LRNP7AVCNFSM6AAAAABVBRGLF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMBRGE4TMNZTGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
No problem, glad to hear it! I have now confirmed that if the call to Here is a screen recording of the test I did to confirm this. My theory is that for some reason, the As some evidence for this theory, I searched for and did not find a "Drive added: G" line in the original debug log KremmenUK included with his issue. That line would have appeared in the full log if that |
@wharvex are you ready for a review? |
@yaira2 Yes I think it's ready now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not been able to reproduce the issue KremmenUK reported but Google Drive is working as it does in Preview 3.8.12.0.
The detection for removing Google Drive from the Drives section is working better on this branch then in Preview too.
@wharvex thank you |
Related Issues
Background
Files.App.Services.StorageDevicesService.GetDrivesAsync()
.foreach
over the drives returned from a basicDriveInfo.GetDrives()
call (where each iterated drive is stored in the temporary variabledrive
).foreach
there is anif
that skips the current iteration if thedrive
is Google Drive or pCloud.if
as the "Cloud Drive Filter If" -- CDFI)drive.Name
to the file system paths of Google Drive and pCloud.G:\
) and then the CDFI skipped any drive with that path, under the assumption that this was Google Drive and therefore a cloud drive.G:\
, but a different, non-cloud drive actually assigned toG:\
, which we would want to appear under the plain "Drives" sections.Solution Approach
drive.Name
in the CDFI, useFile.App.Utils.Storage.DriveHelpers.GetExtendedDriveLabel
to get theDriveInfo.VolumeLabel
of thedrive
, and compare that to the string "Google Drive".drive
that only a Google Drivedrive
would have, and it does not rely on the Registry, which can contain misleading Google Drive artifacts if Google Drive is in a "partially uninstalled" state on the user's system.Summary of Changes
StorageDevicesService
: Remove logic that (1) gets the Google Drive path with a Registry query, (2) times the Registry query, and (3) saves the Google Drive path toApp.AppModel.GoogleDrivePath
, because the Google Drive path is no longer needed inStorageDevicesService
, it was only used in the CDFI.StorageDevicesService
: Get the drive label and use it in the CDFI, as described in Solution Approach.StorageDevicesService
: Edit/add some comments.GoogleDriveCloudDetector
: Add logic that (1) gets the Google Drive path with a Registry query, (2) times the Registry query (moved back here fromStorageDevicesService
).GoogleDriveCloudDetector
: Change a variable name and edit/add some comments.Test Plans
drive
has "Google Drive" as its drive label (and is therefore skipped by the CDFI)driveLabel
local variable for each iteration of theforeach
inStorageDevicesService.GetDrivesAsync
.driveLabel
for thedrive
whoseName
is "G:" equal "Google Drive"?drive
that has "G:" as its path (which is what KremmenUK's dashcam drive was) does not have "Google Drive" as its drive label (and is therefore not skipped by the CDFI)GoogleDriveCloudDetector.GetRegistryBasePath
finds in the registry.driveLabel
local variable for each iteration of theforeach
inStorageDevicesService.GetDrivesAsync
.driveLabel
for thedrive
whoseName
is "G:" equal "Google Drive"?