-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make synced folder init/enable date persistent #4787
Make synced folder init/enable date persistent #4787
Conversation
65f1dd1
to
160c2f3
Compare
Unit test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/11508 |
Codecov Report
@@ Coverage Diff @@
## master #4787 +/- ##
============================================
+ Coverage 17.51% 17.65% +0.13%
Complexity 3 3
============================================
Files 376 377 +1
Lines 32385 32406 +21
Branches 4569 4580 +11
============================================
+ Hits 5673 5721 +48
+ Misses 25797 25765 -32
- Partials 915 920 +5
|
@ArisuOngaku Thanks for this PR 🙏 @tobiasKaminsky @mario fancy taking a look/review ❤️ Code-wise it seems fine to me, besides one minor question regarding data migration for existing db entries. |
160c2f3
to
f6cace8
Compare
There you go, disabled folders get enable_date = -1 and enabled get enable_date = System.currentTimeMillis() This avoids existing enabled folders from uploading old files, which when actually desired, should be satisfied by #4788 |
f6cace8
to
c6e70c6
Compare
IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/11528 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/main/java/com/owncloud/android/datamodel/SyncedFolderDisplayItem.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/datamodel/SyncedFolderProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/datamodel/SyncedFolderProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/providers/FileContentProvider.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/ui/adapter/SyncedFolderAdapter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/owncloud/android/ui/adapter/SyncedFolderAdapter.java
Outdated
Show resolved
Hide resolved
c6e70c6
to
3a44bba
Compare
3a44bba
to
e2acd56
Compare
e2acd56
to
e22948e
Compare
So I discovered dagger on my last push; I tested my code of course, but still, how can you tell whether dagger is available in a class? I'm not 100% sure for in |
e22948e
to
93ea3ff
Compare
93ea3ff
to
aec83c9
Compare
Yeah sorry for that, please be sure I learnt from this situation. |
Nothing to be sorry for! Just happy about your ping 🥇 |
I'll take another look evening.
|
@tobiasKaminsky @AndyScherzinger @ArisuOngaku I have only 1 minor comment - not sure if this is important so feel free to ignore it. Rest looks LGTM. |
Signed-off-by: Alice Gaudon <alice@gaudon.pro>
Ok, so I'd this is not likely to happen due to our bugs, we don't care about stacktrace too much although it won't hurt to have it.
Feel free to close the review and carry on as I won't be available for the rest of the business day.
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/11626.apk |
Complexity increasing per file
==============================
- src/main/java/com/owncloud/android/datamodel/SyncedFolder.java 1
- src/main/java/com/owncloud/android/providers/FileContentProvider.java 3
Complexity decreasing per file
==============================
+ src/main/java/com/owncloud/android/utils/FilesSyncHelper.java -1
See the complete overview on Codacy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codacy306Lint
SpotBugs (new)
SpotBugs (master)
|
@tobiasKaminsky LGTM code-wise from @ezaquarii's and my perspective. Fancy taking a look? ❤️ |
I did following test:
As I understand it, this PR should then also upload those images within the disabled timespan, or? But how should this work, if we have "only" enabled timestamp?
But instead we would need the 1500s (disabled timestamp), or? |
@tobiasKaminsky No, this pull request does not aim to upload files in a synced folder that were created while the folder was disabled. This pull request only aims to correctly upload all files that are created while a synced folder is enabled, even when the app is closed (aka not monitoring changes) and later opened again. Before this PR, the app effectively resetted this timestamp at each launch, meaning that when it crashed or wasn't started, any file created during this period would never get uploaded even if the synced folder was enabled. edit: Though that could actually be a design ambiguity of the meaning of what enabled/disabled for a synced folder means. I took it as "don't upload files that are created in this folder while it's down". |
Ah, then I misunderstood the idea of it and now it makes sense and this PR fits totally fine. Thanks for your great enhancement ❤️ |
No problem, it's been a pleasure ! ❤️ |
As you are a member of nextcloud, you can open up a branch next time directly in this repo, so you do not have to your own. I am looking forward to "see" you next time :-) |
Alright, thanks for that ! I'm most likely going to work on #4788 now. |
21ef006 Merge pull request #4858 from nextcloud/changeScreenshot 0223085 shorten text a bit 8879179 Drone: update FindBugs results to reflect reduced error/warning count [skip ci] 94502f6 Merge pull request #4787 from ArisuOngaku/auto-upload-start-date-persistence 2110937 Merge pull request #4839 from nextcloud/dependabot/gradle/markwonVersion-4.2.0 f1a0ac5 [tx-robot] updated from transifex a00677c daily dev 20191119
As seen in #1150 :
When the app crashes, is not run for some reason, and that files are added in auto upload folders during this downtime, even if the folders were enabled before and successfully synced some files, there are some that get ignored because the sync start time of an auto upload folder is reset when the application restarts.
This pull request fixes this bug/undesirable behavior.