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

Fix: Fixed crash that would sometimes occur when updating #16976

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yaira2
Copy link
Member

@yaira2 yaira2 commented Mar 23, 2025

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.

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. Opened Files ...
  2. ...

yaira2 added 2 commits March 23, 2025 00:22
Signed-off-by: Yair <39923744+yaira2@users.noreply.github.com>
@yaira2 yaira2 force-pushed the main branch 2 times, most recently from 30cea65 to decf3da Compare March 24, 2025 21:33
@yaira2 yaira2 requested a review from Copilot March 27, 2025 01:24
Copy link

@Copilot 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 a crash that could occur during the update process of the Files launcher by improving exception handling and asynchronous operations. Key changes include:

  • Returning early if the target launcher exe file doesn't exist.
  • Wrapping file hash comparison and file copy operations in try-catch blocks with appropriate exception handling (COMException, IOException, and UnauthorizedAccessException).
  • Adding asynchronous configuration with AsTask() and ConfigureAwait(false) for improved reliability.
Files not reviewed (1)
  • src/Files.App (Package)/Package.appxmanifest: Language not supported


Logger?.LogInformation("Files.App.Launcher updated.");
}
catch (COMException ex)
Copy link
Preview

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

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

Consider handling IOException during the file copy operation as well (similar to the hash file comparison block) to ensure all potential I/O errors are caught during the copy process.

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant