Skip to content

fix: detect remote path changes during folder sync - #5064

Open
jesmrec wants to merge 3 commits into
masterfrom
fix/deleted_file_stays_app
Open

jesmrec wants to merge 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 from 74792ff to ef3d0b0 Compare November 26, 2026 12:34
Signed-off-by: Jesus Recio <[email protected]>
@jesmrec
jesmrec force-pushed the fix/deleted_file_stays_app branch 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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)

1 participant