Skip to content

Convert FileOperationsHandler + FileTagsHandler to helpers #10008

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 23 commits into from
Oct 19, 2022
Merged

Convert FileOperationsHandler + FileTagsHandler to helpers #10008

merged 23 commits into from
Oct 19, 2022

Conversation

itsWindows11
Copy link
Contributor

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

Validation
How did you test these changes?

  • Built and ran the app
  • Tested the changes for accessibility

Screenshots (optional)
Add screenshots here.

Copy link
Member

@hez2010 hez2010 left a comment

Choose a reason for hiding this comment

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

Did a rough review and left some suggestions.

@itsWindows11
Copy link
Contributor Author

itsWindows11 commented Sep 18, 2022

hmm, I don't think there's another process that's using this file

---> System.IO.IOException: The process cannot access the file 'C:\Users\itswi\AppData\Local\Packages\FilesDev_ykqwq8d6ps0ag\LocalState\filetags.db' because it is being used by another process.

@hez2010
Copy link
Member

hez2010 commented Sep 21, 2022

Can you verify is Files still able to launch? I cannot launch Files on my computer with this PR anymore, it hangs in the background constantly.

@itsWindows11
Copy link
Contributor Author

Can you verify is Files still able to launch? I cannot launch Files on my computer with this PR anymore, it hangs in the background constantly.

Works for me, dunno why it shouldn't work for you

@hez2010
Copy link
Member

hez2010 commented Sep 21, 2022

Works for me, dunno why it shouldn't work for you

Did you try deploying a Release package and running it?

@itsWindows11
Copy link
Contributor Author

Nope, will try in a few hours

@hez2010
Copy link
Member

hez2010 commented Sep 21, 2022

May related: #10031
Will test again after that PR merged.

@hez2010
Copy link
Member

hez2010 commented Sep 21, 2022

May related: #10031
Will test again after that PR merged.

Can confirm it's #10031.

Other findings:

  • Paste: doesn't work
  • Delete: doesn't work
  • Property-Security: doesn't work
  • Create items: doesn't work

@hez2010
Copy link
Member

hez2010 commented Sep 21, 2022

hmm, I don't think there's another process that's using this file

---> System.IO.IOException: The process cannot access the file 'C:\Users\itswi\AppData\Local\Packages\FilesDev_ykqwq8d6ps0ag\LocalState\filetags.db' because it is being used by another process.

This is expected becuase now we are trying to open filetags.db across multiple Files instances, which is not supported by LiteDB. You can leave this problem as is and open a new issue for it. We need to use something like mutex to make sure there's only one connection simultaneously, and synchronize the database operations across multiple instances.

@itsWindows11
Copy link
Contributor Author

I see, will do

@yaira2 yaira2 requested a review from hez2010 September 22, 2022 15:50
@hez2010
Copy link
Member

hez2010 commented Sep 22, 2022

Properties - Details doesn't work.
When paste or delete multiple files, the "ongoing task" doesn't reflect the process properly.
Paste and Delete still doesn't work if there're multiple Files instances running simultaneously.

@itsWindows11
Copy link
Contributor Author

itsWindows11 commented Sep 23, 2022

Properties - Details doesn't work.

I can reproduce this even when building from the main branch so doesn't seem related to this PR.

When paste or delete multiple files, the "ongoing task" doesn't reflect the process properly.
Paste and Delete still doesn't work if there're multiple Files instances running simultaneously.

Will take a look.
EDIT: Attempting to fix that issue results in a crash with the same filetags.db problem, I don't really know how to fix it.

@itsWindows11
Copy link
Contributor Author

Any news? cc. @hez2010 @yaichenbaum

@hez2010
Copy link
Member

hez2010 commented Sep 30, 2022

Sorry for the delay. Will take care of this PR in next few days.

@yaira2
Copy link
Member

yaira2 commented Oct 12, 2022

@itsWindows11 almost ready to look at this, can you resolve the merge conflicts?

@itsWindows11
Copy link
Contributor Author

Sure thing, expect some commits tomorrow.

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM
Just noticed the build error

@itsWindows11
Copy link
Contributor Author

itsWindows11 commented Oct 14, 2022

Doesn't look like a build error I can fix; I can compile the app on my end.
image

Copy link
Member

@hez2010 hez2010 left a comment

Choose a reason for hiding this comment

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

LGTM and tested ok except when it comes to multiple files instances.
@yaichenbaum I think it's fine to merge it as is.
We will need to change how we use LiteDB to open the connection and close it immediately after finishing db operations, and use a Mutex for inter-process synchronization. I'm currently working on this and will open a follow-up PR.

@yaira2
Copy link
Member

yaira2 commented Oct 19, 2022

@itsWindows11 thank you for all you work and keeping up with this PR!

@yaira2 yaira2 merged commit d317985 into files-community:main Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants