# Liveview diff tracking with pub/sub

**URL:** <https://forum.elixirforum.com/t/liveview-diff-tracking-with-pub-sub/36361>\
**Category:** Questions\
**Tags:** phoenix, troubleshooting, liveview\
**Created:** [December 21, 2020, 2:51pm UTC](https://forum.elixirforum.com/t/liveview-diff-tracking-with-pub-sub/36361 "2020-12-21T14:51:51Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![50kudos](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/50kudos/32/4435_2.png) [@50kudos](https://forum.elixirforum.com/u/50kudos)\
**Post date:** [January 13, 2021, 1:29pm UTC](https://forum.elixirforum.com/t/liveview-diff-tracking-with-pub-sub/36361/7 "2021-01-13T13:29:24Z")

</div>

Normally, yes, Diff = Current - Previous, right? The example code has `temporary_assigns: [comment: nil, children: []]}` so once view is rendered, and new comment is submitted, `fetched_children - [] = fetched_children`. (I didn’t pull the code and run debugging though that’s why you could try IO.inspect in update function there)

I’d debug both the broadcaster and the receiver. The broadcaster has `children: [new_comment]` on their socket, but receiver will call `send_update` which will call `preload/1` and `update/2` the first parameter (assigns) of `update/2` will come from the `send_update` and through `preload/1`, and the second parameter is existing `socket.assigns` (at this point it should be empty `[]`), and it will merge the `assigns` (first parameter) into it.

Did you try debugging around the preload and update function? I won’t be sure for sure until I really pull the code down, run, and debug. Hope this helps a little more. 🙂

---

_[View the full topic](https://forum.elixirforum.com/t/liveview-diff-tracking-with-pub-sub/36361)._
