So as part of a larger project I'm working on creating a simple javascript extension that reads notifications. Code looks as follows: https://github.com/aoh0x7DE/diaspora/blob/0d2a4973398be1cb8387fba444f6503cd7a8e2b4/app/assets/javascripts/matrix.js . Unfortunately it needs to poll every second to feel real time. If we remove the filter to try to make it only return if there is an event, it does indeed return the count for the specific room but not others. The thing is, if there are no events in a room, the request will return no events for that room, meaning that there will also be no unread_notifications count for that room because that magically disappears if there are no events.
As per https://github.com/matrix-org/synapse/pull/926 and https://matrix.to/#/!DdJkzRliezrwpNebLk:matrix.org/$14686556611517EDanG:kentshikama.com
@KentShikama