<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="295688" data-post-id="295688">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="codeanpeace" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/codeanpeace/120/10278_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  codeanpeace
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for linking to the interesting discussion and background there.</p>
<p>It seems like it’s specifically the conditional rendering of LiveComponents that would result in these orphaned subscriptions for unmounted LiveComponents in complex LiveViews. For simpler medium sized LiveViews that don’t have that problem or aren’t sending many updates to begin with, it could still be a good approach from a simplicity standpoint. For others, LiveQuery could well be the right tool for the job.</p>
<p>While not an ideal solution, one possible workaround off the top of my head would be to have LiveComponent acknowledge receipt so the LiveView can assume those that don’t have been unmounted and unsubscribe them. That would curtail the long tail of updates sent to orphan subscriptions, but would also obviously add a good bit of complexity and may well not be worth it. ¯\_(ツ)_/¯</p>
<p>Regardless, it was interesting to see what drove you to create LiveQuery!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295688" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/livequery-a-new-way-to-load-data-for-your-live-views/54777/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-295688" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295688"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="295754" data-post-id="295754">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="AHBruns" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/AHBruns/120/27529_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  AHBruns
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, the acknowledgment approach is interesting. I’m thinking something like:</p>
<ol>
<li>send the update to the live component</li>
<li>immediately after send a message to yourself</li>
<li>have your consumer live components synchronously write an ack to a known place in the process dictionary when they receive updates</li>
</ol>
<p>Then if you receive the message to yourself w/o an ack having been written to the process dictionary, you know the update was never received and the live component is down since message ordering is a guarantee of BEAM.</p>
<p>I may actually implement this for LiveQuery since it would allow me to target re-renders based on what’s using a query rather than re-rendering the whole live view every time any used query changes. Only downside is that, if two live components are using the same query they will be updated in different renders allowing for tearing where different UI components show conflicting data.</p>
<p>I suppose I could always fallback to a rendering the closest common ancestor. Would be complex as hell to implement, but that’s the point of libraries. Eating the complexity so consumers don’t have to.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295754" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/livequery-a-new-way-to-load-data-for-your-live-views/54777/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-295754" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295754"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="295755" data-post-id="295755">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="AHBruns" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/AHBruns/120/27529_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  AHBruns
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I think I’ll break this out into yet another library since the concept for reliable sub-process message in live views is much broader than LiveQuery.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="295755" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/livequery-a-new-way-to-load-data-for-your-live-views/54777/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-295755" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="295755"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>