Manual refresh keeps stale file metadata after concurrent folder refresh inserts duplicate cache rows (35.0.1)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
Read FileContentProvider.upsertSingleFile(), RefreshFolderOperation.prefillLocalFilesMap(), and OCFileExtensions.filterFilenames() at stable-35.0.1. Trace how concurrent folder refreshes insert and select rows for the same account/path, then inspect the existing database and folder refresh tests. Done means refreshes show current metadata, preserve local download and sync state, and leave one cache row per account/path, including when legacy duplicates exist.
索引モデルが issue の本文から書いたものです。
説明
⚠️ Before posting ⚠️
- This is a bug, not a question or an enhancement.
- I've searched for similar issues and didn't find a duplicate.
- I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- I agree to follow Nextcloud's Code of Conduct.
Steps to reproduce
- On Android 35.0.1, browse a previously uncached directory while MetadataWorker is fetching that directory in the background. This timing-dependent race was captured twice on a real phone.
- The foreground RefreshFolderOperation and MetadataWorker both prepare inserts for the same account/path before either batch commits. Check the local public provider: two filelist rows now have the same account, path and remote_id.
- On the server, overwrite a PDF at the same path with a larger, newer PDF; keep its server fileid unchanged. Also rename a sibling directory and add a new file.
- Pull down to refresh the parent directory, wait for completion, navigate away/back, then refresh again.
- Compare the visible size/date and local provider rows with authenticated DAV PROPFIND and GET results. No account removal, app-data clearing, or reinstall is necessary for reproduction.
Expected behaviour
One completed manual refresh should show the current directory names and file metadata. A same-path replacement should show the current size/date. Cache identity should be unique per account/path, and concurrent metadata writes must preserve local download and folder-sync state.
Actual behaviour
The list continues to show the old PDF size/date through repeated manual refreshes. In the second controlled reproduction, cache row 1455 remained at 1584 bytes and the old modification time, while row 1457 for the SAME account/path/remote_id was updated to 2649 bytes and the new modification time. Both media_path values were NULL: this was not a stale downloaded PDF. The server fileid remained 33307.
A renamed old directory survived the first refresh because only one duplicate was scheduled for removal; another refresh removed it. A fresh fetch through Recent files updated the first file row and the list then showed the new size. Opening/downloading the PDF separately retrieved the correct newer bytes.
The same stale-list symptom also occurred when publishing by moving the old file into history and creating a new file at the original path, so a changed server fileid is not required.
Android version
16
Device brand and model
realme Neo7 (RMX5060)
Stock or custom OS?
Stock
Nextcloud android app version
35.0.1, versionCode 350000190, Google Play
Nextcloud server version
34.0.4.1
Using a reverse proxy?
Yes
Android logs
Scoped logcat excerpt, directory path anonymized:
10-18 21:28:57.933 22888 30602 D FileDataStorageManager: Saving folder /RefreshRace/ with 2 children and 0 files to remove
10-18 21:28:57.937 22888 30602 D FileDataStorageManager: Sending 3 operations to FileContentProvider
10-18 21:28:57.937 22888 3242 D FileDataStorageManager: Saving folder /RefreshRace/ with 2 children and 0 files to remove
10-18 21:28:57.940 22888 3242 D FileDataStorageManager: Sending 3 operations to FileContentProvider
Thread 30602 was MetadataWorker. Thread 3242 was foreground folder refresh. Public provider snapshots confirmed the duplicate rows after these batches. Full logs contain private filenames and are retained locally rather than posted wholesale.
Server error logs
Authenticated PROPFIND returned 207 with the current size, modification time and ETag. Authenticated GET returned 200 with the expected current PDF bytes. Local loopback and the public reverse-proxy route matched. Full server application logs are not included; the evidence here is the authenticated DAV responses and scoped access-log correlation.
Additional information
Source inspection at stable-35.0.1 (e6a4ade5047a90992a70652d0d5df658fd9a7c82):
- FileContentProvider.upsertSingleFile() calls INSERT with CONFLICT_IGNORE first. FileEntity only has the autogenerated _id primary key; there is no unique constraint on account/path, so this insert does not conflict. Serialized applyBatch transactions alone cannot prevent duplicate rows when both batches were prepared before the first commit.
- RefreshFolderOperation.prefillLocalFilesMap() collapses duplicates by remote path and refreshes one row.
- OCFileExtensions.filterFilenames() uses distinctBy(fileName), so the first stale row can hide the updated row.
Candidate correction: atomic account/path lookup-and-write, preservation of existing local download/sync columns on a raced insert, newest-fetched metadata selection for legacy duplicates, and removal of every duplicate for a directory path absent from the refreshed listing. No destructive database migration or account reset is proposed.
Validation of the candidate build is still pending; the observations above are from the original signed Google Play client. The source analysis and candidate patch were prepared with OpenAI Codex assistance under the account owner's explicit direction. No human code review or DCO certification is claimed.
- 主要言語
- Kotlin
- スター
- 5.7k
- フォーク
- 2.1k
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 135
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/android のほかの issue
-
0. Needs triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
nextcloud/android#17845 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Lock owned by another client (e.g. Text app) cannot be unlocked from the app対応中かも @falkloewert が 28 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nextcloud/android#17837 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
0. Needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nextcloud/android#17533 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
RC 34.1.0-01: Duplicated wording in creation menu — "New" prefix + creator name produces "New New document" ("Neu Neues Dokument")対応中かも @ChristianTannheimer が 118 日前に担当しました。 オープン0. Needs triage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
nextcloud/android の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Kotlin/kotlin-lsp#309 ·
-
area:data-quality importer size:S
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
enorm-labs/event-junkie#5136 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
Type: Possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
spacecowboy/Feeder#1318 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
wangzan101/Mika#644 ·
メンテナーはふだん 1 日以内に返信