Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

  • Closes #FILES-APP-2B4

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Verified that Files app initializes correctly when Google Drive paths are present but inaccessible as local storage.
  2. Checked that a warning message is logged when a Google Drive path cannot be accessed during app initialization.
  3. Confirmed that the Google Drive icon is loaded correctly even when the path is not directly accessible, and that exceptions are handled gracefully.
  4. Manually triggered the conditions that previously caused the ArgumentException to ensure the fix prevents the crash.

Fixes FILES-APP-2B4. The issue was that: Google Drive paths, not local to Windows Storage APIs, cause ArgumentException during app initialization.

  • Wrap StorageFolder.GetFolderFromPathAsync calls in GoogleDriveCloudDetector with FilesystemTasks.Wrap to handle potential exceptions when accessing Google Drive paths as local storage.
  • Log a warning message if the path cannot be accessed.
  • Wrap StorageFile.GetFileFromPathAsync call when getting the Google Drive icon to handle potential exceptions.

This fix was generated by Seer in Sentry, triggered by Yair. 👁️ Run ID: 864978

Not quite right? Click here to continue debugging with Seer.

@yaira2 yaira2 changed the title Reliability: Handle exceptions when accessing Google Drive paths Code Quality: Handle exceptions when accessing Google Drive paths Aug 18, 2025
@yaira2 yaira2 added the ready for review Pull requests that are ready for review label Aug 18, 2025
@yaira2 yaira2 marked this pull request as ready for review August 18, 2025 15:39
@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed ready for review Pull requests that are ready for review labels Aug 18, 2025
@yaira2 yaira2 requested a review from Copilot August 18, 2025 20:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes crashes that occur during Files app initialization when Google Drive paths are present but not accessible as local Windows storage. The main issue was that the app would throw ArgumentException when trying to access Google Drive paths through Windows Storage APIs.

Key changes:

  • Wraps StorageFolder.GetFolderFromPathAsync calls with exception handling to prevent crashes when Google Drive paths can't be accessed as local storage
  • Adds warning logging when Google Drive paths are inaccessible
  • Updates the Google Drive icon loading method to handle exceptions gracefully

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yaira2 yaira2 merged commit 907c392 into main Aug 18, 2025
9 checks passed
@yaira2 yaira2 deleted the seer/google-drive-path-exception-handling branch August 18, 2025 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants