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

Abierto
#3,415 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
android, java
Área
mobile

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Java
Estrellas
1.1k
Forks
176
Merge medio
23 h 22 min
PR fusionados (30 d)
25

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/notes-android

Todos los issues de nextcloud/notes-android

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.