fix: ensure turbo stream names are generated based on decorated object#961
Conversation
Alexander-Senko
left a comment
There was a problem hiding this comment.
The goal is not just to fix Turbo's behavior in this particular case. We want GIDs to point to records every time they are passed between server and client sides. I hope #to_param is meant for that.
| include ::GlobalID::Identification | ||
|
|
||
| # NOTE: Ensure turbo stream names are generated based on decorated object | ||
| delegate :to_gid_param, to: :object |
There was a problem hiding this comment.
| delegate :to_gid_param, to: :object | |
| delegate :to_gid_param, :to_sgid_param, to: :object |
There was a problem hiding this comment.
i totally missed this from your suggestion in the issue discussion... mb!
|
added delegation of I'm not sure I fully understand your comment though as im not familiar with GlobalID all too much, so let me know if there are any other things we need to take care! 🙏 |
Alexander-Senko
left a comment
There was a problem hiding this comment.
The last thing is to figure out why SGIDs fail to match half of the time.
|
it seems like there's a timing related flake. A Signed Global ID seems to include an expiration timestamp in the ms range. Example: To get around that, I included Let me know if that works 👍 |
Alexander-Senko
left a comment
There was a problem hiding this comment.
@markokajzer, thanks for your contribution, great job!
@seanlinsley, could we release a patch?
Description
closes #960 via suggested fix.
#928 introduced a subtle issue where turbo stream names are generated based on the decorated object, not the actual object as before.