You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
Hey guys! First of all thank you for the work you've done on this implementation, it's a great starting point to implementing turbo with django and I think It'll only get better.
I have a question concerning the dom_target that generated in get_dom_target in BroadcastableMixin. I have recreated the simple chat application, this is my model setup:
The problem I am encountering is, whenever a message changes, there's a signal sent with dom_target pointing at messages. I don't think that should be the case, I'd like to target. specific message_<pk> to avoid re-rendering all the messages (which btw don't render with that setup, all my messages get replaced with just a single one - the updated one).
An example signal that gets sent, as you see dom_target is messages not message_9:
I think get_dom_target should by default return f"{self._meta.verbose_name.lower()}_{self.pk}", I don't really see how messages is helpful. Am I missing something or is this some sort of a bug? If you need more I could share my playground repo with you.
The text was updated successfully, but these errors were encountered:
I just confirmed the exact same thing happens in the experiments chat demo. Entire messages container gets replaced with the singular edited message, whenever a message is changed.
Huh, this must have been a but that snuck in there in a more recent commit. I'll try and take a look this weekend and get back to you, hopefully with a fix. Thanks for reporting this!
While using streams, the whole loop gets re-rendered in templates which changes the position of the updated instance in the template. I think this needs an urgent fix
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey guys! First of all thank you for the work you've done on this implementation, it's a great starting point to implementing turbo with django and I think It'll only get better.
I have a question concerning the dom_target that generated in
get_dom_target
inBroadcastableMixin
. I have recreated the simple chat application, this is my model setup:And these are the templates:
The problem I am encountering is, whenever a message changes, there's a signal sent with dom_target pointing at
messages
. I don't think that should be the case, I'd like to target. specificmessage_<pk>
to avoid re-rendering all the messages (which btw don't render with that setup, all my messages get replaced with just a single one - the updated one).An example signal that gets sent, as you see dom_target is
messages
notmessage_9
:I think
get_dom_target
should by default returnf"{self._meta.verbose_name.lower()}_{self.pk}"
, I don't really see howmessages
is helpful. Am I missing something or is this some sort of a bug? If you need more I could share my playground repo with you.The text was updated successfully, but these errors were encountered: