Skip to content

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

BatPio added 13 commits January 19, 2023 22:54
#	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
Copy link
Author

BatPio commented Mar 19, 2025

@ZetaTom @jancborchardt
Thank you for the code review, I made changes

@ZetaTom
You are right, the phrase "Delay file upload" can be misleading. I changed it to "Minimum file age"

@jancborchardt
I replaced DurationPicker with a list with fixed values

After combining both ideas:
Screenshot_20250319_214900Screenshot_20250319_214929Screenshot_20250319_214942

Since the sync interval in Android is 15 minutes, I think this value is not useful. Instead, I would add values of 6 hours and 3 days

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Since the sync interval in Android is 15 minutes, I think this value is not useful. Instead, I would add values of 6 hours and 3 days

@BatPio sure, sounds good. :) Also, the wording of "No restrictions" could be changed to "Upload immediately" which might be a bit more clear?

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Looks good from the design side now. :)

@BatPio
Copy link
Author

BatPio commented Mar 25, 2025

@alperozturk96 @ZetaTom

I've reworked the UI as suggested by @jancborchardt . Could you please review the changes?

BatPio added 3 commits March 25, 2025 22:58
…ified-master-v2

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/88.json
#	app/src/main/java/com/nextcloud/client/database/NextcloudDatabase.kt
Signed-off-by: batpio <[email protected]>
@BatPio BatPio requested review from ZetaTom and alperozturk96 April 23, 2025 20:32
@jancborchardt
Copy link
Member

@tobiasKaminsky @alperozturk96 @ZetaTom could you give this a review? :)

@tobiasKaminsky
Copy link
Member

Will review tomorrow

BatPio added 10 commits May 13, 2025 21:08
…ified-master-v2

# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/89.json
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
# Conflicts:
#	app/schemas/com.nextcloud.client.database.NextcloudDatabase/90.json
#	app/src/main/java/com/nextcloud/client/database/NextcloudDatabase.kt
Signed-off-by: batpio <[email protected]>
# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.kt
…ation-fixes

# Conflicts:
#	app/src/androidTest/java/com/nextcloud/client/SyncedFoldersActivityIT.java
#	app/src/main/java/com/owncloud/android/datamodel/FilesystemDataProvider.java
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
// -> Rest of this file check takes not even 1 ms.
filesystemDataProvider.storeOrUpdateFileValue(contentPath,
cursor.getLong(column_index_date_modified), isFolder,
cursor.getLong(column_index_date_modified) * 1000,
Copy link
Author

Choose a reason for hiding this comment

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

In all other places storeOrUpdateFileValue is called with milliseconds, but DATE_MODIFIED stores timestamp in seconds format
https://developer.android.com/reference/android/provider/MediaStore.MediaColumns#DATE_MODIFIED

BatPio added 2 commits August 8, 2025 21:28
Signed-off-by: batpio <[email protected]>
Signed-off-by: batpio <[email protected]>
@BatPio
Copy link
Author

BatPio commented Aug 11, 2025

Will review tomorrow
@tobiasKaminsky

Hi, I updated my branch to master and resolved the conflicts with the database version. Could you please do a review?

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