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

Uploads storage manager sync #5488

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ashpieboop
Copy link
Contributor

@ashpieboop ashpieboop commented Feb 18, 2020

Fixes #5487

What this PR does:

  • Make UploadsStorageManager a singleton
  • Make UploadListAdapter observe UploadsStorageManager and refresh on update

Testing

This is a bugfix PR that adds no features, I assume no additional testing is required.

@nextcloud-android-bot
Copy link
Collaborator

@ashpieboop ashpieboop force-pushed the uploads_storage_manager_sync branch from c12e66e to 0ff8881 Compare February 18, 2020 09:22
@nextcloud-android-bot
Copy link
Collaborator

@tobiasKaminsky
Copy link
Member

Observing the whole uploads section of the database doesn't seem to make any difference regarding #5487

So this does not help? Or do I understand it wrong?

@ashpieboop
Copy link
Contributor Author

If anything directly modifies the database without going through UploadsStorageManager, Observing the database directly is important. However this PR actually fixes the original specific issue with its first 2 commits alone, but that's the Observable solution on UploadsStorageManager "accessors". There is another mechanism, "messages", that is an alternative and I haven't studied it yet, hence the draft.

@ashpieboop ashpieboop force-pushed the uploads_storage_manager_sync branch 2 times, most recently from 194a7ca to 3d580ab Compare February 25, 2020 11:25
@ashpieboop ashpieboop force-pushed the uploads_storage_manager_sync branch from 3d580ab to d5ec93c Compare February 25, 2020 12:02
@ashpieboop
Copy link
Contributor Author

I found a todo that says the "Message" system is to get rid of in favor of Observables.

Pending build then I'll request reviewing

@nextcloud-android-bot
Copy link
Collaborator

@ashpieboop ashpieboop marked this pull request as ready for review February 25, 2020 12:36
@nextcloud-android-bot
Copy link
Collaborator

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

@nextcloud-android-bot
Copy link
Collaborator

@nextcloud-android-bot
Copy link
Collaborator

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12814.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.

@nextcloud-android-bot
Copy link
Collaborator

Codacy

354

Lint

TypemasterPR
Warnings7676
Errors00

SpotBugs (new)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings69
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings77
Security Warnings45
Dodgy code Warnings139
Total383

SpotBugs (master)

Warning TypeNumber
Bad practice Warnings26
Correctness Warnings69
Internationalization Warnings13
Malicious code vulnerability Warnings5
Multithreaded correctness Warnings9
Performance Warnings77
Security Warnings45
Dodgy code Warnings139
Total383

@codecov
Copy link

codecov bot commented Feb 26, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@5d428fe). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master    #5488   +/-   ##
=========================================
  Coverage          ?   21.99%           
  Complexity        ?        3           
=========================================
  Files             ?      398           
  Lines             ?    33480           
  Branches          ?     4697           
=========================================
  Hits              ?     7365           
  Misses            ?    24932           
  Partials          ?     1183
Impacted Files Coverage Δ Complexity Δ
...c/main/java/com/nextcloud/client/di/AppModule.java 80.76% <ø> (ø) 0 <0> (?)
...ncloud/android/ui/activity/UploadListActivity.java 54.47% <100%> (ø) 0 <0> (?)
...owncloud/android/ui/adapter/UploadListAdapter.java 14.01% <100%> (ø) 0 <0> (?)

@tobiasKaminsky
Copy link
Member

@ArisuOngaku I am really sorry for coming back so late :S
Is this still valid, as you say that Observables might get removed?

@ashpieboop
Copy link
Contributor Author

ashpieboop commented Jun 30, 2020

@ArisuOngaku I am really sorry for coming back so late :S
Is this still valid, as you say that Observables might get removed?

@tobiasKaminsky I think I didn't mean that; my point is that I found a "TODO" comment somewhere that said that:

  • We should get rid of the "Message" system
  • We should use the "Observable" instead

I believe that this PR is still relevant unless something new came since I originally submitted that PR.

edit: I removed the note in the PR's first message that could cause some unnecessary confusion.

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.

Multiple instances of UploadsStorageManager
4 participants