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

#7815 Delayed synchronization #11278

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

Conversation

BatPio
Copy link

@BatPio BatPio commented Jan 19, 2023

Fixes #7815
Fixes #2323

  • Tests written, or not not needed
    Some tests are written. I'm waiting for suggestions on what else can be tested.

Delay configuration:

sync_delay

#	CHANGELOG.md
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/66.json
#	app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java
#	app/src/main/java/com/owncloud/android/ui/preview/PreviewVideoActivity.kt
#	app/src/main/res/values-b+en+001/strings.xml
#	app/src/main/res/values-bg-rBG/strings.xml
#	app/src/main/res/values-cs-rCZ/strings.xml
#	app/src/main/res/values-da/strings.xml
#	app/src/main/res/values-de/strings.xml
#	app/src/main/res/values-es/strings.xml
#	app/src/main/res/values-fr/strings.xml
#	app/src/main/res/values-hu-rHU/strings.xml
#	app/src/main/res/values-pl/strings.xml
#	app/src/main/res/values-tr/strings.xml
#	app/src/main/res/values-zh-rCN/strings.xml
#	app/src/main/res/values-zh-rHK/strings.xml
#	app/src/main/res/values-zh-rTW/strings.xml
#	app/src/main/res/values/strings.xml

Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
@codecov
Copy link

codecov bot commented Jan 20, 2023

Codecov Report

Merging #11278 (3d40c3a) into master (aeb1632) will increase coverage by 0.07%.
The diff coverage is 37.20%.

❗ Current head 3d40c3a differs from pull request most recent head 501d1fe. Consider uploading reports for the commit 501d1fe to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #11278      +/-   ##
============================================
+ Coverage     31.44%   31.52%   +0.07%     
- Complexity     3413     3427      +14     
============================================
  Files           575      577       +2     
  Lines         42018    42146     +128     
  Branches       5660     5664       +4     
============================================
+ Hits          13214    13286      +72     
- Misses        26861    26905      +44     
- Partials       1943     1955      +12     
Impacted Files Coverage Δ
...com/nextcloud/client/database/NextcloudDatabase.kt 100.00% <ø> (ø)
...cloud/client/database/entity/SyncedFolderEntity.kt 0.00% <0.00%> (ø)
...java/com/nextcloud/client/di/ComponentsModule.java 0.00% <ø> (ø)
...in/java/com/nextcloud/client/jobs/FilesSyncWork.kt 21.95% <0.00%> (-0.18%) ⬇️
...loud/android/datamodel/FilesystemDataProvider.java 4.39% <0.00%> (-0.10%) ⬇️
...oud/android/datamodel/SyncedFolderDisplayItem.java 35.29% <ø> (ø)
...ncloud/android/datamodel/SyncedFolderProvider.java 10.93% <0.00%> (-0.18%) ⬇️
...ain/java/com/owncloud/android/db/ProviderMeta.java 100.00% <ø> (ø)
...cloud/android/ui/activity/SyncedFoldersActivity.kt 20.43% <0.00%> (-0.55%) ⬇️
.../dialog/SyncedFolderPreferencesDialogFragment.java 0.00% <0.00%> (ø)
... and 11 more

Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
@BatPio BatPio marked this pull request as ready for review January 21, 2023 22:34
@BatPio BatPio linked an issue Jan 21, 2023 that may be closed by this pull request
Copy link
Member

@AlvaroBrey AlvaroBrey left a comment

Choose a reason for hiding this comment

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

I haven't tested this yet, especially to see how this will behave with existing autoupload folders. This can't be tested without adressing my first comment below, however.

Having said that, this looks quite promising! Thanks for contributing @BatPio

@BatPio BatPio requested a review from AlvaroBrey April 24, 2023 18:38
@nextcloud-android-bot
Copy link
Collaborator

@andreapx
Copy link

@BatPio is this still a work in progress or has it been abandoned?

Signed-off-by: batpio <[email protected]>
…ified-master-v2-update-to_master

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/69.json
#	app/screenshots/gplay/debug/com.nextcloud.client.SyncedFoldersActivityIT_testSyncedFolderDialog.png
#	app/src/main/java/com/nextcloud/client/database/NextcloudDatabase.kt
#	app/src/main/java/com/owncloud/android/datamodel/FilesystemDataProvider.java
#	app/src/main/java/com/owncloud/android/db/ProviderMeta.java
#	app/src/main/java/com/owncloud/android/ui/activity/SyncedFoldersActivity.kt
#	app/src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.kt
#	app/src/main/java/com/owncloud/android/ui/dialog/parcel/SyncedFolderParcelable.java
@BatPio BatPio marked this pull request as draft August 4, 2024 17:09
@BatPio BatPio self-assigned this Aug 4, 2024
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
@AndyScherzinger AndyScherzinger requested review from JonasMayerDev and alperozturk96 and removed request for AlvaroBrey August 4, 2024 18:48
Signed-off-by: batpio <[email protected]>
@BatPio
Copy link
Author

BatPio commented Aug 4, 2024

@JonasMayerDev @alperozturk96

Hi, sorry for delay, I updated my branch to master and now I have a problem with check:
"TooManyFunctions - 15/15 - [Class 'SyncedFolderPreferencesDialogFragment' with '15' functions detected. "

Can you give me some suggestions on what can be moved out of this class?

@BatPio BatPio marked this pull request as ready for review August 4, 2024 19:24
@alperozturk96
Copy link
Collaborator

alperozturk96 commented Aug 5, 2024

@JonasMayerDev @alperozturk96

Hi, sorry for delay, I updated my branch to master and now I have a problem with check: "TooManyFunctions - 15/15 - [Class 'SyncedFolderPreferencesDialogFragment' with '15' functions detected. "

Can you give me some suggestions on what can be moved out of this class?

You can use

@Suppress("TooManyFunctions")

this annotation to suppress it, or you can create a new class, e.g. DelaySyncDialogManager and move new functions inside it.

@BatPio
Copy link
Author

BatPio commented Aug 5, 2024

@alperozturk96

Thanks for advice

I couldn't find any example of DialogManager in the project, so I used @Suppress("TooManyFunctions") . I think the presence of showUploadDelayDialog in SyncedFolderPreferencesDialogFragment is acceptable, because they are closely related.

I think MR is ready for CR

@uspecies
Copy link

i just wonder what the upper limit for the day value will be? as i guess i may choose everything between 1 to 12 months in days.
So for example 31 days may not satisfy all users #just saying :p

i will start using NC after this PR is released :) cheers!

…ation-simplified-master-v2

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/82.json
#	app/src/main/java/com/owncloud/android/db/ProviderMeta.java
Signed-off-by: batpio <[email protected]>
…ation-simplified-master-v2

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/84.json
#	app/src/main/java/com/owncloud/android/db/ProviderMeta.java
Signed-off-by: batpio <[email protected]>
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.

Allow setting a delay before auto upload / auto upload on-device deletion delayed / scheduled auto-upload
6 participants