Note body overwritten with the app's own error text when loading content fails

オープン
#3,415 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
android, java
領域
mobile

調査の方向性

Start with NotesServerSyncTask.pushLocalChanges around line 150, then follow the sync flow from NotesServerSyncTask.run. Check how failed content loads are represented before local changes are pushed. Done means an error or status message is shown without replacing the note body, and sync can retry later.

索引モデルが issue の本文から書いたものです。

説明

Environment

  • Nextcloud Notes for Android 35.0.0 (version code 350000090, play), signed in through the Nextcloud Files app (SSO)
  • Android 16 / API 37, Pixel 9 Pro (caiman)
  • Nextcloud server 34.0.5.1, server app notes 6.1.0

What happened

  1. A note existed on the server, 7041 bytes, real content.
  2. For a few seconds the server could not read the file (infrastructure problem on our side, file_get_contents(): Failed to open stream: Permission denied → OCP\Files\GenericFileException). While that was going on, the note was opened in the app and the editor showed Fehler: OCP\Files\GenericFileException instead of the content.
  3. Afterwards the note on the server was 40 bytes and contained:
Fehler: OCP\\Files\\GenericFileException

A version file created at the same second (…v1793375498) holds the same text with single backslashes, 38 bytes.

Why this looks client-side

The server log has no request and no error at the time of the write, so the write itself succeeded. The error string was uploaded as the note body by the client, and the backslashes were escaped on the second write.

Expected

The app should never write its own error or status text into the note body. Show the error, leave the note untouched, retry the sync later.

Impact

Silent data loss: the original 7041-byte note was replaced by an error message and would have been pushed to the server on the next sync.

Stack trace of the failing sync

java.lang.Exception: {"errorType":"Exception"}
[com.nextcloud.android.sso.InputStreamBinder.processRequestV2(InputStreamBinder.java:440), ...]
	at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.pushLocalChanges(NotesServerSyncTask.java:150)
	at it.niedermann.owncloud.notes.persistence.NotesServerSyncTask.run(NotesServerSyncTask.java:99)

Happy to provide server logs or a recording if that helps.

主要言語
Java
スター
1.1k
フォーク
176
平均マージ
23時間 22分
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextcloud/notes-android のほかの issue

nextcloud/notes-android の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。