mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.25k stars 1.36k forks source link

iOS app - Notification badge is not correct #7680

Open andreineacsu opened 11 months ago

andreineacsu commented 11 months ago

Summary

The notification badge on iOS is not correct in most of the times

Steps to reproduce

  1. Send 4 messages to an account that has the iOS app installed.
  2. The badge should display 4.
  3. Read them on Web or Desktop.
  4. The iOS badge is still 4.
  5. Open the iOS app - iOS badge is still 4.
  6. Write again to the same account - badge is 1.

Expected behavior

The iOS badge should update once the messages are read disregarding the platform they were read.

amyblais commented 11 months ago

Hi @andreineacsu,

  1. What OS version are you on?
  2. What Mattermost mobile app version are you on?
andreineacsu commented 11 months ago

iOS 17.1.1 App version 2.10.0

amyblais commented 11 months ago

Opened https://mattermost.atlassian.net/browse/MM-55713.

LukasFiniarel commented 11 months ago

My app always shows a very high number of messages in the badge (for example 22). When I open Mattermost, I have no new messages. When I close it, the number in the badge disappears. But it comes back after a while.

I am using Mattermost Beta 2.11.0 (498) with an iPhone 12 and Ios 17.1.2

However, the error has existed for much longer.

larkox commented 11 months ago

@LukasFiniarel In the logs (Profile -> Settings -> Report a problem), you may find some log messages like

Setting the badge count based on database values to X

Or

Not updating badge count, since we have no mentions in the database, and the number of notifications in the notification center is X

Do you mind checking what message do you see and what is the value you are seeing?

LukasFiniarel commented 11 months ago

I get "Setting the number of badges based on database values to 0" a few times.

The badge displayed 36 before opening.

Complete log:

2023/12/11 12:31:54:595 INFO Launch app in Home screen
2023/12/11 12:31:54:615 INFO channel switch to Anwesenheit akkmytrnjtb17fchg4rgukymth 25 ms
2023/12/11 12:31:54:615 INFO websocket connecting to wss://HOSTNAME/api/v4/websocket?connection_id=&sequence_number=0
2023/12/11 12:31:54:685 INFO Running "Home
2023/12/11 12:31:54:707 INFO Running "Channel
2023/12/11 12:31:54:917 DEBUG Setting the badge count based on database values to 0
2023/12/11 12:31:55:087 DEBUG error on fetchBindings Received invalid response from the server.; JSON could not be serialized because of error:
Die Daten konnten nicht gelesen werden, da sie nicht das korrekte Format haben.
2023/12/11 12:31:55:092 INFO websocket connected to wss://HOSTNAME/api/v4/websocket?connection_id=&sequence_number=0
2023/12/11 12:31:55:092 INFO wss://HOSTNAME/api/v4/websocket?connection_id=&sequence_number=0 got connection id  3kfq4wkq3bnk7be1saj8up435r
2023/12/11 12:31:55:733 INFO WEBSOCKET RECONNECT MODELS BATCHING TOOK 47ms
2023/12/11 12:31:55:739 DEBUG Setting the badge count based on database values to 0
2023/12/11 12:31:59:715 DEBUG error on fetchThreads Response with status code 500
2023/12/11 12:32:03:646 DEBUG error on fetchThreads Response with status code 500
2023/12/11 12:32:03:898 DEBUG Setting the badge count based on database values to 0
2023/12/11 13:44:59:599 INFO Launch app in Home screen
2023/12/11 13:44:59:602 INFO channel switch to Anwesenheit akkmytrnjtb17fchg4rgukymth 11 ms
2023/12/11 13:44:59:603 INFO websocket connecting to wss://HOSTNAME/api/v4/websocket?connection_id=&sequence_number=0
2023/12/11 13:44:59:647 INFO Running "Home
2023/12/11 13:44:59:652 INFO Running "Channel
2023/12/11 13:44:59:914 DEBUG error on fetchBindings Received invalid response from the server.; JSON could not be serialized because of error:
Die Daten konnten nicht gelesen werden, da sie nicht das korrekte Format haben.
2023/12/11 13:44:59:920 INFO websocket connected to wss://HOSTNAME/api/v4/websocket?connection_id=&sequence_number=0
2023/12/11 13:44:59:920 DEBUG Setting the badge count based on database values to 0
2023/12/11 13:44:59:920 INFO wss://HOSTNAME/api/v4/websocket?connection_id=&sequence_number=0 got connection id  9tq8kunruinbxfagt3a1jxkdoo
2023/12/11 13:45:00:520 INFO WEBSOCKET RECONNECT MODELS BATCHING TOOK 57ms
2023/12/11 13:45:00:521 DEBUG Setting the badge count based on database values to 0
2023/12/11 13:45:04:666 DEBUG error on fetchThreads Response with status code 500
2023/12/11 13:45:05:290 INFO Running "Settings
2023/12/11 13:45:08:553 DEBUG error on fetchThreads Response with status code 500
2023/12/11 13:45:12:433 DEBUG error on fetchThreads Response with status code 500
2023/12/11 13:45:12:502 DEBUG error on fetchBindings Received invalid response from the server.; JSON could not be serialized because of error:
Die Daten konnten nicht gelesen werden, da sie nicht das korrekte Format haben.