Replies: 1 comment 2 replies
-
Hey!
What do you mean by fresh render? It would be great to see more WS messages (sent and received) right before you observe duplication. (You can also enable debug logs: In theory, receiving the same message twice is possible when requesting history, though the chances are low. We do not de-dup messages at the protocol/client level (though that's something we consider to add in the future). We recommend handling duplicates at the application level; for example, Turbo Streams do that for you if you use IDs. i.e., the |
Beta Was this translation helpful? Give feedback.
-
Hey guys, how is it going? I'm testing Anycable's reliable streams in a Rails app and want to make sure I have the right mental model here.
Let's say we have two pages with different
turbo_stream_from
sources. As we navigate between those pages we subscribe and unsubscribe from eachTurbo::StreamsChannel
. With reliable streams enabled (createCable({ protocol: "actioncable-v1-ext-json" })
), the payload includeshistory.since
, which is working as expected.Problem: if the content on page A changes while we're on page B, and that change was broadcasted with an append action, page A will end up with duplicated items on the next visit. One from the fresh render and another from reliable stream's confirm history synchronization.
Is this the expected behavior, even though the websocket stayed connected during the navigation? I can provide a sample application if it helps showcase what I described.
Env: the rails app uses both
anycable-rails
andanycable-rails-jwt
, RPC-less setup (--jwt_id_key
and--turbo_rails_key
passed to anycable-go),redisx
broadcast adapter andmemory
broker.Beta Was this translation helpful? Give feedback.
All reactions