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

未关闭
#3,415 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
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
平均合并
21 小时 27 分钟
30 天内合并 PR
32

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

nextcloud/notes-android 的其他 Issue

查看 nextcloud/notes-android 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。