Skip to content

Fix: Fixed issue where changing file permission for multiple files simultaneously would crash the app #10886

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

Merged
merged 18 commits into from
Jan 6, 2023

Conversation

hecksmosis
Copy link
Contributor

@hecksmosis hecksmosis commented Dec 30, 2022

Resolved / Related Issues
Items resolved / related issues by this PR.

Validation
How did you test these changes?

  • Built and ran the app

@yaira2 yaira2 changed the title Fix: Adding permissions to multiple files at the same time crashes the app Fix: Fixed issue where changing file permission for multiple files simultaneously would crash the app Dec 30, 2022
hecksmosis and others added 2 commits December 30, 2022 17:13
Co-authored-by: yaira2 <39923744+yaira2@users.noreply.github.com>
@yaira2 yaira2 requested a review from QuaintMako December 30, 2022 16:20
yaira2
yaira2 previously approved these changes Dec 30, 2022
@QuaintMako
Copy link
Contributor

While this does fix the crash for me, I'm not sure if the fix is the correct solution.

It reminds me of #10728 where I fixed a crash with a surface fix, but Gave92 did some exploration and fixed an bigger underlying problem.

Here we have a null object, while the Properties.xaml.cs can hold the several objects in the page inside its navParameterItem field it seems. Mave the SaveChangesAsync should take a list of ListedItem instead of one? I am not sure, it's only a surface level analysis here.

I'd suggest to take this fix, for it fixes a pretty important problem : if the application crashes, you simply lose your files. And it's not gonna be in the recycle bin from what I can see. But we need to dive further into the problem and fix the root of the cause.

@gave92
Copy link
Member

gave92 commented Dec 30, 2022

Indeed fairly sure this would break renaming Drives.

Edit: pushed a suggested change. ItemFileName being null is not related to the item parameter being null (e.g for Drives). The parameter was confusing, I've removed it and now SaveBaseAsync() has similar signature of the other Save methods. Just in case I've also added a null check on ItemFileName itself.

QuaintMako
QuaintMako previously approved these changes Dec 30, 2022
Copy link
Contributor

@QuaintMako QuaintMako left a comment

Choose a reason for hiding this comment

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

LGTM.

@hecksmosis
Copy link
Contributor Author

Is it ok now?

Copy link
Contributor

@QuaintMako QuaintMako left a comment

Choose a reason for hiding this comment

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

LGTM.

@yaira2 yaira2 requested review from gave92, jiejasonliu and yaira2 and removed request for jiejasonliu January 5, 2023 17:53
@gave92 gave92 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Jan 6, 2023
@yaira2 yaira2 merged commit 9d9b0d5 into files-community:main Jan 6, 2023
QuaintMako pushed a commit to QuaintMako/Files that referenced this pull request Jan 8, 2023
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.

Bug: Changing file permission for multiple files simultaneously crashes app
5 participants