Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Info] Notification badge unread count tips (discussion)

Abierto
#511 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
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
18/100
Tipo de issue
Documentación
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
rust, sqlite

Línea de trabajo

No implementation file, test, or entry point is named. Start by reading matrix-rust-sdk PR 4285 and the linked Matrix discussion; this issue currently has no concrete change request or definition of done.

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

Descripción

blocked

Just noting this here for future use, for when Robrix supports notifications on mobile and we need to calculate the count of unread messages/notifications.

Danny from the Element X iOS team made this very helpful comment (and there is some context behind it as well) https://matrix.to/#/!qSsPTKDfMGYqhgiLPJ:flipdot.org/$_rJfoHNfV7O4oo_h7go1GA0V5ZBMkgO5DmAu9AuCa_8?via=flipdot.org&via=matrix.org&via=element.io

Relevant conversation snippets are copied here for posterity:

Danny:

I'm working on the notification badge count in a fork of Element X iOS (hopefully can push the changes upstream). I'm seeing that the notification extension isn't persisting the incoming notification that it looks up with a sliding sync to the main database. I see there is cross-process locking implemented, and I have the main app force quit when I test. Any idea why the NotificationClient isn't writing to the shared DB? Or gotchas in regard to this? Perhaps I should not be expecting it to be persisted at all and this is not implemented yet.

Ivan:

The state store isn’t cross-process “friendly”. It’s in-progress, and sadly paused due to other projects with higher priority.

Danny:

dang, it seems that's how Signal and Telegram compute a reliable badge count locally. I'll come up with some backup method for now. Or maybe look into making it cross-process friendly. I would appreciate any links to issues regarding the current status on that project if possible. Thank you

Ivan:

https://github.com/matrix-org/matrix-rust-sdk/pull/4285 and this comment especially https://github.com/matrix-org/matrix-rust-sdk/pull/4285#issuecomment-2488655073. That’s for the generalisation of the cross-process lock poison. But but but it won’t solve the badge counter. This will just allow to access the state store from different processes. To get a correct badge counter, we need to automatically back paginate. I have started to write an issue for that but it still a draft since a week.

I see, thank you for the pointers. I've decided to compute the count locally based on the rooms, messages, etc in the local database. Computing the count is smooth in the main app, and for now to compute it in the notification service extension (iOS), I've added a lightweight shared sqlite DB in the shared app group. It basically just stores all the roomID's that have live notifications (based on the settings the user selects in the app). Then the extension uses that and the information for the incoming notifications room to compute the count.

Of course the badge count currently is the number of rooms with unread messages, not the actual unread messages count. But I think we will add a toggle in the app to let the user decide.

In this way we avoid any inaccurate server side counts, as there were reports of ghost badge counts that never go away even with no unread messages in the main app.

The main issue with a solution like this is if you have multiple devices. But when registering the phone's "push id" I added the "content-available:1" flag to the default payload that will be sent with all notifications to wake up the main app, where it can perform a sliding sync, persist it, and fix up this new lightweight shared DB. Of course "content-available" is not reliable and at most may open the main app twice an hour I hear. And it doesn't open the main app if it is force quit I believe.

Ideally the extension one day will be able to write back what it has learned about the incoming notifications room to the main database and there will be no issues with multiple devices. A kludge but as elegant as possible. Since refactoring the cross process lock and getting the notification service extension to persist that data feels like a much larger fix.

Manu:

this is a very smart approach, Danny. Where do you manage this shared sqlite DB? Is it on the iOS app side or on a fork of the SDK

Danny:

Thanks Manu, I manage the shared sqlite db on the iOS app side

Lenguaje dominante
Rust
Estrellas
496
Forks
70
Merge medio
1 h 27 min
PR fusionados (30 d)
73

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 project-robius/robrix

Todos los issues de project-robius/robrix

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.