"Mark as read" in the conversation list does not remove the notification

Abierto Apto para principiantes
#929 1 comentario 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
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
83/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
android, kotlin
Área
mobile

Línea de trabajo

Empieza en app/src/main/kotlin/org/fossify/messages/adapters/ConversationsAdapter.kt, en ConversationsAdapter.markAsRead(), y compara su comportamiento con el de archivar/eliminar y MarkAsReadReceiver. Reproduce el problema marcando una conversación como leída desde la lista mientras su notificación de SMS está presente. Se considera terminado cuando esa acción elimina también la notificación, además de marcar la conversación como leída.

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

Descripción

bug needs triage
Checklist
  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.
Affected app version

1.10.1

Affected Android/Custom ROM version

Android 16 (One UI 8.5)

Affected device model

Samsung Galaxy A54 (SM-A546E), also reproduced on the Android Studio emulator (API 36)

How did you install the app?

No response

Steps to reproduce the bug
  1. Receive an SMS while the app is closed (a notification is shown).
  2. Open the app, long-press that conversation, open the menu and choose Mark as read.
Expected behavior

The notification of that conversation is removed, like when you open the conversation or press "Mark as read" in the notification.

Actual behavior

The conversation is marked as read, but its notification stays. On Samsung the launcher badge counts notifications, so the icon still shows 1 unread.

Screenshots/Screen recordings

No response

Additional information

ConversationsAdapter.markAsRead() does not cancel the notification, while archive, delete and MarkAsReadReceiver do:
https://github.com/FossifyOrg/Messages/blob/cf045ab5bdd36814be2b3d287cc294ce3f2b3fc7/app/src/main/kotlin/org/fossify/messages/adapters/ConversationsAdapter.kt#L239-L253

Suggested fix:

conversationsMarkedAsRead.filter { conversation -> !conversation.read }.forEach {
    activity.markThreadMessagesRead(it.threadId)
    activity.notificationManager.cancel(it.threadId.hashCode())
}

Optional extra safety (what I did in my fork): when the main screen opens, cancel the message notifications (shortcutId = thread id, not bubbles) of threads that have no unread SMS/MMS in the provider. This also cleans notifications left by other paths, for example a thread read by another app.

Found and tested in a personal fork built from 1.10.1 (only unrelated features added). The code involved is unchanged on main (cf045ab). Fix in the fork, for reference: https://github.com/fatehiman/peppa-ai-messages/commit/44d2d3876

Lenguaje dominante
Kotlin
Estrellas
1.6k
Forks
187
Merge medio
22 h 13 min
PR fusionados (30 d)
18

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 FossifyOrg/Messages

Todos los issues de FossifyOrg/Messages

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.