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.

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. Checked that drag and drop operations do not cause errors when performed immediately after the application starts.
  2. Verified that ShellViewModel is properly initialized before drag and drop operations are handled.
  3. Ensured that the application remains stable and responsive during and after drag and drop operations.

@yaira2 yaira2 marked this pull request as ready for review September 16, 2025 19:10
@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Sep 16, 2025
@yaira2 yaira2 requested a review from Copilot September 16, 2025 19:10
@yaira2 yaira2 changed the title Bugfix: Prevent drag and drop race condition Code Quality: Prevent drag and drop race condition Sep 16, 2025
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 a race condition in drag and drop operations by adding null checks for the ShellViewModel before processing drag operations. The fix prevents errors that occur when drag and drop events are triggered before the application is fully initialized.

  • Added null checks for _associatedInstance.ShellViewModel in both DragOverAsync and DropAsync methods
  • Sets AcceptedOperation to None and returns early when ShellViewModel is not yet initialized
  • Ensures proper completion of deferrals to maintain application stability

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

@yaira2 yaira2 merged commit 1de1109 into main Sep 16, 2025
9 checks passed
@yaira2 yaira2 deleted the seer/fix/drag-drop-race-condition branch September 16, 2025 19:43
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