Repository navigation
Conversation
There was a problem hiding this comment.
Thanks for the contribution @mvanhorn! Some comments about this PR
NOTE: Do not forget to split the changes into three commits: one for the fix, one for test (using the test: prefix) and another one for the calens file (chore: add calens file)
When the etag still matches but sharedByLink, permissions, or the boolean sharedWithSharee value differ (null and false count as equal), the child is now handled by the existing update branch in refreshFolder, so its share fields are saved while local properties and the local etag are kept. Fixes owncloud#4938 Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019jP1NBrfG9D7pKJLkd5yre
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019jP1NBrfG9D7pKJLkd5yre
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019jP1NBrfG9D7pKJLkd5yre
b3b7759 to
72c0a3c
Compare
|
Thanks for the review, @joragua. I've addressed everything:
The OCFileRepositoryTest suite and the full owncloudData unit tests pass locally, and detekt is clean. |
joragua
left a comment
There was a problem hiding this comment.
The second CR round is here @mvanhorn! Just check the comments below and it should be ready for QA 😄
NOTE: It's not necessary to create new commits for the changes. You can rebase the branch and include the changes in the existing commits. Let us know if you have any doubts!
| localChildToSync.localModificationTimestamp > remoteChild.lastSyncDateForData!! || | ||
| isActionSetFolderAvailableOfflineOrSynchronize | ||
| isActionSetFolderAvailableOfflineOrSynchronize || | ||
| // The etag does not always change when only share metadata changes. |
There was a problem hiding this comment.
I think this comment could be removed since the method name is already descriptive enough 👍🏻
|
|
||
| @Suppress("MaxLineLength") | ||
| @Test | ||
| fun `refreshFolder saves a folder child when the etag matches but share badges changed`() { |
There was a problem hiding this comment.
To follow the naming convention of the other tests:
| fun `refreshFolder saves a folder child when the etag matches but share badges changed`() { | |
| fun `refreshFolder returns a list with the OCFile that changed when the etag matches but sharedByLink changed`() { |
|
|
||
| @Suppress("MaxLineLength") | ||
| @Test | ||
| fun `refreshFolder saves a folder child when the etag matches but share badges changed`() { |
There was a problem hiding this comment.
What about the sharedWithSharee and permissions conditions? 🤔 We should create new tests for these, since they cover different scenarios. Do you agree? @jesmrec any comment about this?
There was a problem hiding this comment.
yep, that conditions are really unit, so they could be tested as unitary tests.
Related Issues
App:
Not claimed: this diff changes no changelog or release-note file.
ReleaseNotesViewModel.ktcreating a newReleaseNote()with String resources (if required)Not claimed:
ReleaseNotesViewModel.ktwas not run locally either.QA
When the etag still matches but sharedByLink, permissions, or the boolean sharedWithSharee value differ (null and false count as equal), that child is added to the files saved for the folder. The saved row keeps local properties, the existing etag, and the thumbnail-update flag, keeps the remote share fields, and is marked available offline through the parent when the parent is available offline. A unit test covers refreshFolder persisting a folder child in that case, and the unreleased changelog notes the badge refresh.
Pull to refresh on ownCloud 10 leaves folder share badges unchanged after a folder is shared or unshared in the web UI. The badges update only after that folder is opened and the user navigates back. Folder refresh writes a child back only when its etag differs from the local row. ownCloud 10 leaves the etag unchanged when only share metadata changes, so a new sharedByLink value, sharedWithSharee value, or permissions value is dropped.
Fixes #4938
AI was used for assistance.