When liking a post, expanded likes vanishes


(Sam Saffron) #1

Repro:

  • Expand likes on a post
  • Like the post
  • Panel with likers disappears

Expected:

User is appended to post.


More severe side effect, if anyone likes a post while you have likes expanded, the expansion will vanish making you think UI is broke.


What needs fixing?

We already subscribe to the “acted” message so we know when post actions happen. postStream only has the very coarse “triggerChangedPost” which does a huge amount of reconciliation.

So we either need:

  • To expand triggerChangedPost to reconcile expanded likes. This is messy cause 1 message from message bus, 1 XHR to get post, 1 extra XHR to get users.

or

  • Introduce a triggerActedPost to reconcile post actions, 1 XHR to get actions, 1 XHR to get users

or

  • Introduce a payload to the message sent and split out acted / removed_act messages, that way you can render the user right away when you get the message and don’t need an extra XHR (very tricky due to security, probably not doable)

Since @eviltrout is planning on working on this (probably next week, leaving it to him)


(Jeff Atwood) #2

This seems like a lot of work for a rather rare, niche situation.


(Sam Saffron) #3

A simple fix is probably not too much work, @eviltrout is planning on paying off some technical debt around post actions so I want to make sure this is paid off while at it.