# Unread count on IOS app doesn't work after upgrade

**URL:** <https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182>\
**Category:** Mobile Apps\
**Created:** [March 16, 2020, 8:53pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182 "2020-03-16T20:53:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [March 16, 2020, 8:53pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/1 "2020-03-16T20:53:20Z")

</div>

I recently upgraded to 5.20 and now the unread count on the iOS app for all of my users just works maybe 1 out of every 100 times. I switched from an Apache reverse proxy to an nginx one but that doesn’t seem to have made a difference.

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [March 16, 2020, 9:01pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/2 "2020-03-16T21:01:59Z")

</div>

What Mattermost mobile app version are you on?

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [March 16, 2020, 9:02pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/3 "2020-03-16T21:02:47Z")

</div>

looks like i’m on 1.29.0

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [March 16, 2020, 11:33pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/4 "2020-03-16T23:33:42Z")

</div>

Can you share a screenshot of what you’re seeing?  
Are users getting push notifications?

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [March 17, 2020, 3:00am UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/5 "2020-03-17T03:00:07Z")

</div>

So I get the lock screen, notification center, and banner notifications (usually - although this doesn’t seem as consistent either) but I rarely get the badge notifications with the red number indicating the number of unread messages.

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [March 17, 2020, 3:31pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/6 "2020-03-17T15:31:49Z")

</div>

Would you be able to check if clearing your current active sessions via **Account Settings \> Security \> View and Logout of Active Sessions** (and then logging back in) helps?

Another option could be to check if upgrading to v5.21 helps with the issue.

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [March 17, 2020, 9:02pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/7 "2020-03-17T21:02:38Z")

</div>

Ok - i tried doing the clearing of all active sessions. That didn’t resolve it. I then did the upgrade to 5.21.0 and then tried again - that didn’t work. I then closed all active sessions again and still doesn’t work.

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [March 18, 2020, 1:51am UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/8 "2020-03-18T01:51:59Z")

</div>

Hello, @richardsonje

For sanity check purposes, can you confirm how the **Settings \> Mattermost \> Notifications** look like on from the affected user’s iOS device?

 ![ios_notification.PNG](https://us1.discourse-cdn.com/flex020/uploads/mattermost/original/2X/1/176315dc56ec90a2f3f3d524c37072f7d6c082d0.jpeg)

For comparison purposes, can you confirm that the unread counter is showing as expected for desktop and web app

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [March 19, 2020, 2:15pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/9 "2020-03-19T14:15:19Z")

</div>

Ok yes that’s how it looks. This isn’t impacting just me, this is impacting the 4 users using the server. through the last couple days I’ve noticed that it is doing a few weird things:  
1.) When you open the iOS app, it will take you to a random position above the current messages  
2.) Sometimes the unread indicator inside the app will kind of stick  
3.) If I get the unread count to show, i have to close the app to get it to mark as read and then it won’t show the unread count for a while  
4.) The unread count indicator doesn’t seem to work on any of the apps - whether it’s on the Mac or iOS

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [March 26, 2020, 5:48pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/10 "2020-03-26T17:48:02Z")

</div>

Any other thoughts on this one? Would providing any of my proxy config help?

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [March 27, 2020, 1:50pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/11 "2020-03-27T13:50:22Z")

</div>

Please help send more details about your config and any log errors you’re seeing.

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [March 30, 2020, 3:51am UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/12 "2020-03-30T03:51:55Z")

</div>

Hi, @richardsonje

Yes, please. Please provide all the configuration as well as the `mattermost.log` when you reproduce the issue so we can dig deeper into this issue. Thanks.

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [March 31, 2020, 3:26pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/13 "2020-03-31T15:26:47Z")

</div>

I’m not really sure how I can forcibly reproduce it - they just don’t work. I would say maybe 1 out of every 100 messages now, if that, I get the badge number.

I’m looking through the logs and these are the only errors I see:

> {“level”:“error”,“ts”:1585623183.4068193,“caller”:“app/web\_conn.go:282”,“msg”:“Invalid session.”,“error”:"GetSession: Invalid session token=mm74btdgwino3r5ws186oez69a, err=, "}  
> {“level”:“info”,“ts”:1585623184.7250674,“caller”:“mlog/log.go:167”,“msg”:“Invalid session”,“error”:"GetSession: Invalid session token=1km9optryb8hig1p5oquwtr4jh, err=, "}

The second one repeats a few times.

A little bit on my setup (and, again, this all worked fine before upgrading to version 5.x - the only difference was I was using an Apache proxy but I had this in place still post-upgrade and it was not working with Apache either):

Chat server: CentOS 8, went through the [Mattermost Documentation](https://docs.mattermost.com/install/install-rhel-7.html#configuring-nginx-as-a-proxy-for-mattermost-server) for the setup and didn’t modify anything. SELinux is running.

Proxy Server: CentOS 8, nginx 1.14.1, here’s the conf file for the proxy:

> upstream backend {  
> server 10.20.5.30:8065;  
> keepalive 32;  
> }
> 
> proxy\_cache\_path /var/cache/nginx levels=1:2 keys\_zone=mattermost\_cache:10m max\_size=3g inactive=120m use\_temp\_path=off;
> 
> server {  
> listen 80;  
> server\_name [chat.domain.com](http://chat.domain.com);
> 
> ```
> include snippets/letsencrypt.conf;
> return 301 https://$server_name$request_uri;
> 
> ```
> 
> }
> 
> server {  
> listen 443 ssl http2;  
> server\_name [chat.domain.com](http://chat.domain.com);
> 
> ```
> ssl on;
> ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
> ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
> ssl_trusted_certificate /etc/letsencrypt/live/domain.com/chain.pem;
> 
> ssl_session_timeout 1d;
> ssl_protocols TLSv1.2;
> ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
> ssl_prefer_server_ciphers on;
> ssl_session_cache shared:SSL:50m;
> 
> location ~ /api/v[0-9]+/(users/)?websocket$ {
> proxy_set_header Upgrade $http_upgrade;
> proxy_set_header Connection "upgrade";
> client_max_body_size 50M;
> proxy_set_header Host $http_host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_set_header X-Forwarded-Proto $scheme;
> proxy_set_header X-Frame-Options SAMEORIGIN;
> proxy_buffers 256 16k;
> proxy_buffer_size 16k;
> client_body_timeout 60;
> send_timeout 300;
> lingering_timeout 5;
> proxy_connect_timeout 90;
> proxy_send_timeout 300;
> proxy_read_timeout 90s;
> proxy_pass http://backend;
> }
> 
> location / {
> client_max_body_size 50M;
> proxy_set_header Connection "";
> proxy_set_header Host $http_host;
> proxy_set_header X-Real-IP $remote_addr;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_set_header X-Forwarded-Proto $scheme;
> proxy_set_header X-Frame-Options SAMEORIGIN;
> proxy_buffers 256 16k;
> proxy_buffer_size 16k;
> proxy_read_timeout 600s;
> proxy_cache mattermost_cache;
> proxy_cache_revalidate on;
> proxy_cache_min_uses 2;
> proxy_cache_use_stale timeout;
> proxy_cache_lock on;
> proxy_http_version 1.1;
> proxy_pass http://backend;
> }
> 
> ```
> 
> }

Let me know what else I can provide that’d be helpful

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [April 6, 2020, 12:10am UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/14 "2020-04-06T00:10:34Z")

</div>

I’ve made an interesting observation the last few days. If I let maybe 10-12 messages go without reading any of them, THEN it will show the badge count. That seems to be the only way I get to see it is when that happens.

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [April 6, 2020, 12:32am UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/15 "2020-04-06T00:32:10Z")

</div>

@ahmaddanial Does the additional information shared above provide a better indication what the issue might be?

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [April 6, 2020, 1:22am UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/16 "2020-04-06T01:22:43Z")

</div>

Hi, @richardsonje

I don’t see anything obvious in the proxy configuration with reference to [Configuring NGINX with SSL and HTTP/2](https://docs.mattermost.com/install/config-ssl-http2-nginx.html) that could impact the badge counter on the iOS app directly. This one is definitely out of the ordinary:

> [@richardsonje](#):
>
> If I let maybe 10-12 messages go without reading any of them, THEN it will show the badge count. That seems to be the only way I get to see it is when that happens.

@amy.blais I’ll ping the mobile developers on this to get their insight on what could have impacted the unread counter.

---

<div class="post-metadata">

**Author:** ![amy.blais](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/amy.blais/32/7481_2.png) [@amy.blais](https://forum.mattermost.com/u/amy.blais)\
**Post date:** [April 6, 2020, 12:13pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/17 "2020-04-06T12:13:08Z")

</div>

Does the unread badge has an incorrect number or it does not show at all?

If it had a different number, are there any archived channels with mentions? Deactivated users?

If the badge is never set, do you get the notification at all? Can you help send the `notifications.log` file?

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [April 6, 2020, 3:16pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/18 "2020-04-06T15:16:49Z")

</div>

No badge shows at all. Here’s a [link to my onedrive](https://justanerdnet-my.sharepoint.com/:u:/g/personal/jeremy_justanerd_net/EetfA-XhEWdMs74YsJ0XuZwByARjIS48vgzl_tEoYkiWDA?e=wz7jPs) with the notifications log.

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [April 8, 2020, 7:16am UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/19 "2020-04-08T07:16:39Z")

</div>

Hello, @richardsonje

Thanks for the update. Before I share this with the team, can you please provide me with the following information so I can cross check the log entries?

```auto
SELECT u.Id, u.Username, u.Email, s.DeviceId, s.Props FROM Users AS u RIGHT JOIN Sessions AS s ON s.UserId = u.Id AND u.Username = "<username>";

```

Keep me posted. Thanks.

---

<div class="post-metadata">

**Author:** ![richardsonje](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@richardsonje](https://forum.mattermost.com/u/richardsonje)\
**Post date:** [April 8, 2020, 11:15pm UTC](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182/20 "2020-04-08T23:15:18Z")

</div>

> [@ahmaddanial](#):
>
> SELECT u.Id, u.Username, u.Email, s.DeviceId, s.Props FROM Users AS u RIGHT JOIN Sessions AS s ON s.UserId = u.Id AND u.Username = “”;

# Id, Username, Email, DeviceId, Props

NULL, NULL, NULL, ‘apple\_rn:9f2844888b6c582ab85cbecb5ce174ba9618b82b710534c1e3a595b54235b8f4’, ‘{"browser":"Safari/13.3.1","csrf":"m6ft4f9bajnt3bmb1ofpr6qypo","is\_guest":"false","os":"iOS","platform":"iPhone"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Chrome/76.0.3809","csrf":"rwaasjtecpn758ssingawiexuc","is\_guest":"false","os":"Windows 10","platform":"Windows"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Safari/13.1.3","csrf":"48jho415opytiry64uhws8ghry","is\_guest":"false","os":"iOS","platform":"iPhone"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Chrome/77.0.3865","csrf":"b7ubcy1abp8czjycr5geeejs4y","is\_guest":"false","os":"Mac OS","platform":"Macintosh"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Desktop App/4.3.1","csrf":"1967ydrtq3fyicgp4iz9errj3h","is\_guest":"false","os":"Mac OS","platform":"Macintosh"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Firefox/74.0","csrf":"xeb7py3e3jdnxr997qq6bybwxr","is\_guest":"false","os":"Mac OS","platform":"Macintosh"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Chrome/77.0.3865","csrf":"sbii39ngzbbpies36jfqcj714h","is\_guest":"false","os":"Mac OS","platform":"Macintosh"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Safari/13.0.1","csrf":"xgeah6kxo3gjxj164e81y31sxr","is\_guest":"false","os":"iOS","platform":"iPhone"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Chrome/79.0.3945","csrf":"694txrricpnt5xyp1zqd44dxya","is\_guest":"false","os":"Android","platform":"Linux"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Chrome/77.0.3865","csrf":"thgz768hrprgjjxttgiysogs9c","is\_guest":"false","os":"Mac OS","platform":"Macintosh"}’  
NULL, NULL, NULL, ‘apple\_rn:5570179a889af069398d162868ece9d766419e090e2bd0f8feb5ef7f5e8144f2’, ‘{"browser":"Safari/13.1.3","csrf":"r4yq85k3pt8fidthoqa3i45gca","is\_guest":"false","os":"iOS","platform":"iPhone"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Desktop App/4.4.0","csrf":"y7g4ben81fbr9mkpurahtn6s7a","is\_guest":"false","os":"Mac OS","platform":"Macintosh"}’  
NULL, NULL, NULL, ‘apple\_rn:de9ceb1b657d67695f1fd93f886dc9bbb8f40094931bd87643cfd05d29a86adb’, ‘{"browser":"Safari/13.1.3","csrf":"5j3qqjxrstgxppo5fe13j8pagh","is\_guest":"false","os":"iOS","platform":"iPhone"}’  
NULL, NULL, NULL, ‘’, ‘{"browser":"Chrome/77.0.3865","csrf":"cahedppfw7f9dnpd4tsm6xbp5o","is\_guest":"false","os":"Mac OS","platform":"Macintosh"}’

That looks really ugly posted … let me know if you need me to clean it up

[Next page](https://forum.mattermost.com/t/unread-count-on-ios-app-doesnt-work-after-upgrade/9182.md?page=2)
