Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

totalUnreadCount is always 0 on app launch #659

Closed
jasnicaa opened this issue Sep 6, 2021 · 8 comments · Fixed by #669
Closed

totalUnreadCount is always 0 on app launch #659

jasnicaa opened this issue Sep 6, 2021 · 8 comments · Fixed by #669
Assignees

Comments

@jasnicaa
Copy link

jasnicaa commented Sep 6, 2021

So I am trying to get the total unread count from the stream and data it is always 0 at first, although when I inspect the client I can see under totalUnreadCount that there is a number. I want to show the number of unread messages in the tabBar when a user enters the app without the need to enter the channel itself.

As you can see on the image both totalUnreadCount and unreadChannels are zero and totalUnreadCount is 3.

Am I missing something here?

Screenshot 2021-09-06 at 15 47 39

@jasnicaa jasnicaa changed the title totalUnreadCountStream is always 0 on app launch totalUnreadCount is always 0 on app launch Sep 7, 2021
@xsahil03x
Copy link
Contributor

Hey @jasnicaa, I am looking into this.

@jasnicaa
Copy link
Author

HI guys, so I was just testing this fix, and still is not working for me as expected.

I enter the app and send a message from another account and when debugging I can see that in the currentUser totalUnreadCount has updated while totalUnreadCount from the Stream is zero. It only updates when I enter the channel.

Screenshot 2021-09-10 at 16 03 18

@imtoori
Copy link
Contributor

imtoori commented Sep 10, 2021

this hasn't been released yet
are you trying it using git dependency?

@jasnicaa
Copy link
Author

no, I saw this
Screenshot 2021-09-10 at 16 10 39

@imtoori
Copy link
Contributor

imtoori commented Sep 10, 2021

yeah that was another issue
you can check the upcoming changelog here https://github.com/GetStream/stream-chat-flutter/blob/develop/packages/stream_chat/CHANGELOG.md

@rickgrade3
Copy link

this hasn't been released yet

Do you have any workaround of this issue before the release?

@imtoori
Copy link
Contributor

imtoori commented Sep 17, 2021

I can't think of nothing right now, but we'll probably publish the next release early next week

@jasnicaa
Copy link
Author

@rickgrade3 If you are using bloc you can create your own totalUnreadCount from currentUser.totalUnreadCount - this number is updating correctly, I started this way but decided to wait for an update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants