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

Check Existence of Folder on RefreshFolderOperation #13744

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Oct 9, 2024

  • Tests written, or not not needed

Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
@alperozturk96 alperozturk96 changed the title Check Existence of Folder BugFix - Check Existence of Folder Oct 9, 2024
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Copy link

github-actions bot commented Oct 9, 2024

Codacy

Lint

TypemasterPR
Warnings5959
Errors33

SpotBugs

CategoryBaseNew
Bad practice6565
Correctness6262
Dodgy code296296
Experimental11
Internationalization77
Malicious code vulnerability11
Multithreaded correctness66
Performance5353
Security1818
Total509509

@tobiasKaminsky
Copy link
Member

That is not a real bugfix, but only hiding the real problem:
How can it be that parameter folder is null?

Please check this.

@alperozturk96
Copy link
Collaborator Author

alperozturk96 commented Oct 9, 2024

That is not a real bugfix, but only hiding the real problem: How can it be that parameter folder is null?

Please check this.

RefreshFolderOperation has 14 constructor usages, and those usages called from multiple places as well. Checking for folder existence and returning the correct result code seems reasonable until we fix the bug. This issue is likely rare and occurs only in specific scenarios, as we’ve never encountered it before. I’ve unlinked the original issue so we can track this bug separately.

If you’re okay with this approach, you can review the PR. Otherwise, I can check all usages and update this PR with fix, but it may take some time.

In any case, RefreshFolderOperation should either check for the existence of a nullable OCFile or not allow passing a nullable OCFile; additionally, the OCFile should not have a null remotePath.

We can do the fix in separate PR or in this one.

@alperozturk96 alperozturk96 changed the title BugFix - Check Existence of Folder Check Existence of Folder on RefreshFolderOperation Oct 9, 2024
@alperozturk96 alperozturk96 marked this pull request as draft October 9, 2024 14:39
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.

3 participants