Re: Group Chat Unread Glitch

10 views
Skip to first unread message

Martin Bruse

unread,
Jul 13, 2018, 1:34:49 PM7/13/18
to Matt Wightman, diplic...@googlegroups.com, diplicity-talk
Yup, it's verified. I have a new channel with 0 unread messages...

Let's move this to diplicity-dev.

On Fri, Jul 13, 2018, 19:31 Matt Wightman <matisy...@gmail.com> wrote:
https://diplicity-engine.appspot.com/Game/ahJzfmRpcGxpY2l0eS1lbmdpbmVyEQsSBEdhbWUYgICAkLyDlQoM

--
You received this message because you are subscribed to the Google Groups "diplicity-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diplicity-tal...@googlegroups.com.
To post to this group, send email to diplici...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/diplicity-talk/b63dc86b-2f29-4976-bc1c-cfdeedbfd973%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Martin Bruse

unread,
Jul 13, 2018, 1:43:16 PM7/13/18
to Matt Wightman, diplic...@googlegroups.com
This is odd, because https://github.com/zond/diplicity/blob/master/game/chat.go#L648 (which is used for all sent messages) calls https://github.com/zond/diplicity/blob/master/game/chat.go#L577 which triggers https://github.com/zond/diplicity/blob/master/game/chat.go#L346 which counts unread messages and _should_ update the counters for all recipients that haven't muted the channel.

(Just as some debugging help for anyone wanting to take a look at this, I'm away from keyboard for two more weeks.)

Martin Bruse

unread,
Sep 21, 2018, 3:40:00 PM9/21/18
to Matt Wightman, diplic...@googlegroups.com
AHMAGAWD, I found the error.

A subtle bit of undefined behavior (that I know very well that it exists, but missed guarding against completely) made the 'unread since X' counter _sometimes_ be wrong.

After a first patch (https://github.com/zond/diplicity/commit/d6574b0a0e8e384348430411af66c7a89d2248d6) to add a test that _didn't_fail_, some head scratching, rerunning the test many times and finding it flaky, and then a second patch (https://github.com/zond/diplicity/commit/1894d78883ac95320e7f6e1b92e3aa4148429de7) to fix the undefined behavior, some more testing that failed to repro the error, and a final rollout I think the problems should be gone.

Woohoo!

tttppp123

unread,
Sep 21, 2018, 4:57:28 PM9/21/18
to diplicity-dev
Wooo! Great news :-)
Reply all
Reply to author
Forward
0 new messages