-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support unread count in conversations #49
Comments
I'd agree to that. At least that gives some primitive, unreliable, form of unread count for the local session only, on servers that do not support Inbox. |
So, API-wise this has 3 components:
Re 1: Re 2: Re 3:
What do you think @valeriansaliou? Other implementation notes: The plan right now is to keep the unread count transient. That is on reload/restart it would be reset to 0 for all rooms. This is where prose-im/prose-pod-system#9 would come into play: On startup the core would request the unread messages from the server and update the unread counts accordingly. I could theoretically persist the unread counts on the server in our sidebar items, which would then sync with other open clients of the same user but I don't think it would provide any value since open clients would also be able to keep track of newly received messages (or carbons for that matter). We could also persist the current unread count locally so that you start in the same state where you left when you've closed the app. But unless we have support for the Inbox XEP each room would then sit in the sidebar with potentially invalid unread counts until you select each room so that its unread count goes to 0 - even if you have seen the messages on another client already. Another alternative would be to actually use the read markers to determine the number of unread messages. The client would then need to send the IDs of messages that are scrolled into the visible area to the core, so that the core can send read markers to the server and decrease the unread count. This kind of depends on the UI where you could either display individual messages as unread or insert a separator above the oldest unread message. In the latter case I would assume the separator to be transient and inserted the next time the room is displayed above the oldest unread message just above the newest read message (i.e. you can have gaps between read messages, but these are ignored). We could also do something like load the last n messages for each room after connect and count the unread messages to update the read counts. Then display something like |
I think I’d go for solution 1. This is IMHO much cleaner that way, at the expense of more ingress events. This also means that weird things won’t happen if the implementation of the ‘set selected’ is done in a wrong or incomplete way in a certain app implementation, at least we still get a count that never gets flushed. |
New API: export interface RoomBase {
// …
markAsRead(): Promise<void>;
} |
When we send a message to a MUC room we'll receive the same message back to our connected BareJid. This was handled as a regular received message and would incorrectly increase the unread count of the affected sidebar item (refs #49).
All implemented as of prose-im/prose-app-web@a5105f4 ; it's working great! Feel free to test :) |
Hm, it doesn't seem to work for me. I'm not able to get rid of the unread count. It's there when I receive a message with the conversation selected and also stays there when I switch back to a conversation with unread messages. How is it supposed to work? |
The unread count should go away when you're:
It will auto-go away when those 2 conditions are matched. If it's still not working for you, could you please provide me with a reproduction scenario/steps? |
I think we can close this for the time being. |
While the proper solution that would work across multiple clients is out of reach at the moment, let's implement a preliminary solution at least. It's a horrible experience to not see when a message comes in, or worse: Hear the sound but not see where it came from. So at least show an unread marker for the affected conversation. It doesn't need to be persisted between launches/reloads but the API could have the final form already.
The text was updated successfully, but these errors were encountered: