Skip to content

fix: detect remote path changes during folder sync to handle server-side rename - #5064

Merged
jesmrec merged 3 commits into
masterfrom
fix/deleted_file_stays_app
Dec 2, 2026
Merged

jesmrec merged 3 commits into
masterfrom
fix/deleted_file_stays_app

Conversation

@jesmrec

@jesmrec jesmrec commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

When a folder is renamed on the server, the app keeps showing the old folder name.

This happens because the sync logic matches local entries to remote ones by remoteId, so a renamed folder is correctly matched to its local counterpart. However, the only condition that triggered an update was an etag change. Since folder etags only reflect changes to their content (not their name), renaming a folder does not change its etag. As a result, the renamed folder's new path was ignored and the local entry kept its old path.

The bug consistently reproduces for available offline folders because the background worker recursively enters subfolders and keeps their etag in sync with the server. For non-av.off. subfolders, this never happens automatically. If the user has never navigated inside, the local etag stays as "". Since "" != server_etag is always true, etagChanged fires on every sync and the rename is detected incidentally. By browsing into the non-av.off. folder and then browsing back, the problem is also reproducible and the fix works as well.

This is specific to folders. File renames do update the etag on the server, so they were already handled correctly.

The fix adds localChildToSync.remotePath != remoteChild.remotePath as an additional condition to trigger a local update. When a renamed folder is matched by remoteId, the path mismatch is now detected and the local DB entry is updated with the new remote path regardless of the etag.

Related Issues

App: #5014

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

@jesmrec
jesmrec force-pushed the fix/deleted_file_stays_app branch 2 times, most recently from ef3d0b0 to ed1bdf7 Compare November 26, 2026 12:48
@jesmrec
jesmrec marked this pull request as ready for review November 26, 2026 12:59
@jesmrec
jesmrec requested a review from a team as a code owner November 26, 2026 12:59
@joragua joragua changed the title fix: detect remote path changes during folder sync fix: detect remote path changes during folder sync to handle server-side rename Dec 1, 2026

@joragua joragua left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some comments here @jesmrec!

Comment thread changelog/unreleased/5064 Resolved
@jesmrec
jesmrec force-pushed the fix/deleted_file_stays_app branch from ed1bdf7 to 7343eea Compare December 1, 2026 15:40
@jesmrec
jesmrec force-pushed the fix/deleted_file_stays_app branch from 7343eea to 160a6aa Compare December 2, 2026 08:41
joragua
joragua previously approved these changes Dec 2, 2026

@joragua joragua left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Ready for QA 🙌🏻

@jesmrec

jesmrec commented Dec 2, 2026 •

Copy link
Copy Markdown
Member Author

QA checks

  • Rename a folder inside another folder in the web client -> in the app, the renamed folder is correctly displayed and the content is correct
  • Mark a folder with subfolders as available offline, rename it on the server, sync -> verify offline content is still accessible under the new name and the rename is correct
  • Rename a folder on the server and add a file inside it, then sync once — verify both the new name and the new file appear
  • Rename a folder twice on the server before syncing — verify the app shows the final name after one sync

…ide renames

Signed-off-by: Jesus Recio <jrecio@izertis.com>
Signed-off-by: Jesus Recio <jrecio@izertis.com>
Signed-off-by: Jesus Recio <jrecio@izertis.com>
@jesmrec

jesmrec commented Dec 2, 2026

Copy link
Copy Markdown
Member Author

Approved

@jesmrec
jesmrec merged commit 6cb485d into master Dec 2, 2026
12 checks passed
@jesmrec
jesmrec deleted the fix/deleted_file_stays_app branch December 2, 2026 11:23
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.

[BUG] Deleted/renamed remote folder stays in file list forever – parent folder sync doesn't remove stale entries (oCIS, 404 loop)

2 participants