[BUG] Deleted/renamed remote folder stays in file list forever – parent folder sync doesn't remove stale entries (oCIS, 404 loop)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start with the log lines: ReadRemoteFolderOperation.kt:101 logs that a synced subfolder's local file is missing, and SynchronizeFileUseCase.kt:56 returns FileNotFound as a Success. Trace how OCFileRepository.readFile and the folder sync path decide whether to delete local entries. Done means that after a parent folder sync, a folder missing from the server response and its children are removed locally, and a 404 on a stale file or folder removes it and returns to the parent.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Actual behaviour
- A folder that was deleted or renamed on the server still shows up in the app, together with its files, even after the parent folder is refreshed.
- The parent folder syncs fine (
207), and the server no longer lists the folder in its response. The app keeps the stale entries anyway. - Opening the stale folder or tapping one of its files gets a
404 Not Foundevery time. The app logs aFileNotFoundExceptionbut never removes the local entries. - When a stale file is tapped, the sync use case returns
FileNotFoundas a Success result, and the UI only says "File must be downloaded before opening it". - "Open in Collabora" still works for these stale files. The file opens and can be edited in Collabora. This suggests the file still exists on the server under its file ID (moved/renamed rather than deleted), and only the app's path-based requests (
/Parent/Subfolder/...) fail with 404. - The user is stuck with "ghost" items that can't be opened, downloaded, synced or cleaned up.
Expected behaviour
- When the parent folder (
/Parent/) syncs and the server no longer listsSubfolder/, the app removesSubfolder/and all its children from the local database. - At the latest, a
404on PROPFIND of a folder or file should mark the local entries as deleted, remove them from the list, and send the user back to the parent folder.
Steps to reproduce
- Set the folder as "available offline"
- In the app, browse and sync a folder that contains files (e.g.
/Parent/Subfolder/withdocument-1.pdfanddocument-2.pdf). - Delete or rename
Subfolderon the server (web UI or another client). - In the app, open
/Parent/and pull to refresh.Subfolderis still listed. Open it, or tap one of its files. You get a 404 error every time and the entries are never removed.
Can this problem be reproduced with the official owncloud server?
(url: https://ocis.ocis.master.owncloud.works, user: einstein, password: relativity)
- not tested yet
Environment data
Android version: 16.1.134
Device model: Nothing Phone (3a) Pro
ownCloud app version: 4.8.4 (build 8fd9e360a)
ownCloud server version: ownCloud Infinite Scale 8.2.1
Logs
Web server error log
Not applicable. The server behaves correctly: the folder is missing from the parent PROPFIND response, and direct requests return a proper 404:
PROPFIND https://<server>/dav/spaces/<space-id>/Parent/ → 207 (Subfolder not listed)
PROPFIND https://<server>/dav/spaces/<space-id>/Parent/Subfolder/ → 404 Sabre\DAV\Exception\NotFound
PROPFIND https://<server>/dav/spaces/<space-id>/Parent/Subfolder/document-1.pdf → 404 Sabre\DAV\Exception\NotFound
PROPFIND https://<server>/dav/spaces/<space-id>/Parent/Subfolder/document-2.pdf → 404 Sabre\DAV\Exception\NotFound
ownCloud log (data/owncloud.log)
Android app log (excerpt):
I: ReadRemoteFolderOperation.kt:97 Synchronized /Parent/ with 9 files. - HTTP status code: 207
W: ReadRemoteFolderOperation.kt:101 Synchronized /Parent/Subfolder/ Local file does not exist
D: ViewModelExt.kt:69 Use case executed: SynchronizeFolderUseCase with result: Error(throwable=com.owncloud.android.domain.exceptions.FileNotFoundException)
I: ReadRemoteFileOperation.kt:75 Read remote file /Parent/Subfolder/document-1.pdf with status 404
I: SynchronizeFileUseCase.kt:56 File does not exist anymore in remote
com.owncloud.android.domain.exceptions.FileNotFoundException
at com.owncloud.android.data.RemoteOperationHandlerKt.handleRemoteOperationResult(RemoteOperationHandler.kt:110)
at com.owncloud.android.data.RemoteOperationHandlerKt.executeRemoteOperation(RemoteOperationHandler.kt:85)
at com.owncloud.android.data.files.datasources.implementation.OCRemoteFileDataSource.readFile(OCRemoteFileDataSource.kt:158)
at com.owncloud.android.data.files.repository.OCFileRepository.readFile(OCFileRepository.kt:334)
at com.owncloud.android.usecases.synchronization.SynchronizeFileUseCase.run(SynchronizeFileUseCase.kt:50)
at com.owncloud.android.usecases.synchronization.SynchronizeFileUseCase.run(SynchronizeFileUseCase.kt:36)
at com.owncloud.android.domain.BaseUseCaseWithResult.invoke(BaseUseCaseWithResult.kt:30)
at com.owncloud.android.extensions.ViewModelExt$runUseCaseWithResult$1.invokeSuspend(ViewModelExt.kt:67)
D: ViewModelExt.kt:69 Use case executed: SynchronizeFileUseCase with result: Success(data=...SynchronizeFileUseCase$SyncType$FileNotFound@f2308a9)
D: FileDetailsFragment.kt:429 /Parent/Subfolder/document-1.pdf : File must be downloaded before opening it
I: ReadRemoteFileOperation.kt:75 Read remote file /Parent/Subfolder/document-2.pdf with status 404
I: SynchronizeFileUseCase.kt:56 File does not exist anymore in remote
D: FileDetailsFragment.kt:429 /Parent/Subfolder/document-2.pdf : File must be downloaded before opening it
- Ngôn ngữ chính
- Kotlin
- Star
- 4.2k
- Fork
- 3.1k
- Merge trung bình
- 3 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của owncloud/android
-
Camera Uploads Contributions are welcome Technical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
owncloud/android#5040 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
KW-related Type:bug UI / UX
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Lint reports an errorĐang mởType:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
owncloud/android#4485 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Contributions are welcome p3-medium Type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
owncloud/android#4300 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
owncloud/android#3720 · 8 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của owncloud/android
Issue tương tự
-
👀 example 📱 iOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
hyochan/react-native-nitro-sound#871 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
android:plan main:plan packages:learn
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ankidroid/Anki-Android#23453 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
afk-ok area:data-quality importer size:S
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
enorm-labs/event-junkie#5278 ·
Maintainer thường phản hồi trong vòng 1 ngày