I'm making a chat app where bro's can send messages to the Broups, the bro groups. I want to remove the message from the server if all the bro's have received the message. I guess the question is if is it better to compare timestamps or to keep track of ids on the message.
If all the receive timestamps are above the message timestamp it can be removed. Or you have a receive id indicator on the message object. If a bro receives the message their id is removed from the message. If the list is empty it can be removed.
I thought comparing timestamps would work fine, and it did on the emulators but there seems to be some situation where a read indicator is send without the message being received yet on the client. Maybe with app inactivity and resuming or a temporary socket disconnect. Not sure what it could have been. But I'm thinking of changing it to tracking ids on the message object to avoid these undesired situations.
I guess I used this question thing more like a thinking out loud option. I'll use a better option next time and sorry for the confusion.
I'm making a chat app where bro's can send messages to the Broups, the bro groups. I want to remove the message from the server if all the bro's have received the message. I guess the question is if is it better to compare timestamps or to keep track of ids on the message.
If all the receive timestamps are above the message timestamp it can be removed. Or you have a receive id indicator on the message object. If a bro receives the message their id is removed from the message. If the list is empty it can be removed.
I thought comparing timestamps would work fine, and it did on the emulators but there seems to be some situation where a read indicator is send without the message being received yet on the client. Maybe with app inactivity and resuming or a temporary socket disconnect. Not sure what it could have been. But I'm thinking of changing it to tracking ids on the message object to avoid these undesired situations.
I guess I used this question thing more like a thinking out loud option. I'll use a better option next time and sorry for the confusion.