Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Private message notifications don't appear in the UI after 1 or 2 messages #2321
OK so I bounced some messages back and forth between me and a test user on my own pod. Conversation was started by test user and as expected I stopped receiving the new message notification in the UI after the first message, but the test user always got it.
From the production.log output it's pretty clear that every time test user sends me a message, the output is pretty much identical, except this is missing:
(this above is when I reply to test user)
Also of course is missing the local receive part which happens when test user receives my message:
So no local dispatch is done is the problem? If so, the problem is probably in this call:
So after trying out various things I went the traditional way of adding a log printout to every decision point that the code can get to (best way to debug! :)). What I noticed was that the path separated totally at this point: https://github.com/diaspora/diaspora/blob/develop/lib/postzord/dispatcher.rb#L75
So, due to
I don't have the knowledge to really say what is the difference with these, anyone? If I force it to always take the route that generates a notification to the conversation starter, when posting as conversation starter it gets notified itself of the reply. If I post as conversation recipient, a nice little loop is triggered and I have to kill the server :)
Anyone who actually knows Ruby want to figure out what is actually wrong and the best way to fix it? :D
Also, the reason I guess the first notification is delivered to the recipient is that the first message is a Conversation object and thus falls down to
I don't really understand the whole logic of the dispatcher, what is supposed to do what. If this is hard to fix in a clean way, maybe better remove the 0.0.2 milestone and rewrite it in a sane way (unless of course the code makes perfect sense but I don't just get it :)). Though a quick fix just to get these notifications would be awesome if someone can figure out what quick fix needs to be added.
Also, it seems this issue as entirely only when recipient of message is on the same pod - at least some testing between pods generates notifications on both ends. Will continue debugging everything past
(for once federation works better than local traffic haha)
I tried to fix this in the dispatcher by making sure that a correct event is dispatched, but it really didn't come out very clean. Unwanted side effects and I'm thinking lots of rewriting of the dispatcher logic to make it simpler would need to be done there, afaik.
So I went the easy way. As whatever happens notification.notify will be called, I put an
Anyway, if someone wants to comment, here are the small changes: jaywink@c700b86