element-hq / element-x-ios

Next generation Matrix client for iOS built with SwiftUI on top of matrix-rust-sdk.
https://element.io/labs/element-x
GNU Affero General Public License v3.0
400 stars 87 forks source link

App icon badge notification count is wrong. #3151

Open ara4n opened 1 month ago

ara4n commented 1 month ago

Steps to reproduce

The badge count on the icon is calculated by the server, not by the app, and so tends to be wrong.

Outcome

What did you expect?

Reliable app icon badge count

What happened instead?

We had https://github.com/element-hq/element-x-ios/issues/2066, but that was exacerbated by a synapse bug now fixed. The overall design problem from https://github.com/matrix-org/matrix-spec-proposals/pull/4076 is still there though, and so the badge counts continue to be wrong...

Your phone model

No response

Operating system version

No response

Application version

675

Homeserver

No response

Will you send logs?

No

itsthejb commented 2 weeks ago

I have suffered from this bug many times! I can accept that this is generally problematic, but going forward, is there any way to force reset the count from Synapse when this issue arises? Otherwise, could some reset cache button be added as an escape hatch as I believe resolves this is regular Element?

pixlwave commented 1 week ago

Otherwise, could some reset cache button be added as an escape hatch as I believe resolves this is regular Element?

This wouldn't help as the app would still be using the count from Synapse I'm afraid.

itsthejb commented 1 week ago

@pixlwave But this is what I can't understand - I don't see this badge issue on any other client than Element X for iOS: even installing Element X on macOS results in the correct badge count. All regular Element clients also display it correctly. It's literally only Element X on my phone 🤷

pixlwave commented 1 week ago

Element iOS is using the badge number from Synapse until you open the app at which point it computes the badge locally as it has a copy of all the messages to use. Element X on the other hand is using Sliding Sync and with this, we don't (yet) have the code to fetch all of the necessary messages in order to do the computation locally.

itsthejb commented 1 week ago

Ah I see. Ok thanks, that makes more sense