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

BugFix - OCShare Conversion #13519

Closed
wants to merge 5 commits into from

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Sep 5, 2024

  • Tests written, or not not needed

Problem?

  • File size, thumbnail not visible in shared tab.
  • Files are not filtered correctly for shared tab

Solution

  • Path can be used for fetching OCFile rather than converting OCShare to OCFile manually

Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Signed-off-by: alperozturk <alper_ozturk@proton.me>
Copy link

github-actions bot commented Sep 5, 2024

Codacy

Lint

TypemasterPR
Warnings6060
Errors33

SpotBugs

CategoryBaseNew
Bad practice6363
Correctness6464
Dodgy code300301
Experimental11
Internationalization77
Multithreaded correctness66
Performance5353
Security1818
Total512513

SpotBugs increased!

Copy link

github-actions bot commented Sep 5, 2024

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

Copy link

github-actions bot commented Sep 5, 2024

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/13519.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@alperozturk96 alperozturk96 requested review from ZetaTom and removed request for ZetaTom September 9, 2024 09:04
Copy link
Collaborator

@ZetaTom ZetaTom left a comment

Choose a reason for hiding this comment

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

Unfortunately this change breaks the Shared tab in some use cases.

If the user doesn't have any shared files in the root directory, the tab will be stuck at Loading.... If there is a shared file in the root folder, this will indeed be displayed correctly. However, any files contained within subdirectories will not be displayed.

shares.add(ocShare);

OCFile file = mStorageManager.getFileByDecryptedRemotePath(ocShare.getPath());
if (file != null && file.getParentId() == currentRootDirId) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

As parseShares() is only called once, currentRootDirId will only be set once. This means that only files directly located within in root directory will show up in the Shared tab.

@@ -547,6 +547,10 @@ public String getParentRemotePath() {
}
}

public boolean isVisibleInSharedTab() {
return isSharedWithMe() || isSharedWithSharee() || isSharedViaLink() || isFolder();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Due to the inclusion of isFolder() all folders will be shown.

Strangely, this doesn't seem to affect the actual result.

@alperozturk96
Copy link
Collaborator Author

nextcloud/server#4456 API needs to be updated. This solution will solve the problem for only existing Files in device. When the device doesn't initially have an OCFile, the path can't be used to retrieve it.

e.g. Shared file can be in a/b/c/d/a.txt --> to display a.txt in shared tab device must have OCFile. In first launch, app doesn't aware of that file and that file can be accessible when user enters the exact same path.

@tobiasKaminsky tobiasKaminsky deleted the bugfix/add-file-info-to-the-share-tab branch October 7, 2024 05:27
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.

2 participants