New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActionCable client ensures subscribe command is confirmed. #41581
ActionCable client ensures subscribe command is confirmed. #41581
Conversation
3ac6b5c
to
9612219
Compare
@spinosa It seems CI is failing, can you take a look? 🙇
|
@zzak I can, and I will. FWIW, the code works and I'm open to any comments. I never stood up the Rails test suite and figured I'd come back to the tests if there was any other interest =) |
d5ae78d
to
30a60f0
Compare
Updated PR with type checking to prevent the errors seen in CI. Tests pass locally, but they always did. They're not the same as the tests run in CI, where the JS test suite is executed on older browsers via saucelabs. |
8eebd95
to
30a60f0
Compare
@spinosa Yes, sorry I haven't had time to check on this recently. Maybe doing a fresh rebase will help clear some of those up? |
30a60f0
to
2d867a2
Compare
@zzak Good call, buildkite CI passed this go around. Waiting on the Linters to run w/ approval from maintainer... |
I'm happy to resolve the new conflicts if there's some hope of getting this merged. @zzak can you help, or point me in a good direction? Thanks! |
I'd like to see this merged. Please do resolve conflicts and I'll help get this in. Thanks for working on it! |
A SubscriptionGuarantor maintains a set of pending subscriptions, resending the subscribe command unless and until the subscription is confirmed or rejected by the server or cancelled client-side. A race condition in the ActionCable server - where an unsubscribe is sent, followed rapidly by a subscribe, but handled in the reverse order - necessitates this enhancement. Indeed, the subscriptions created and torn down by Turbo Streams amplifies the existence of this race condition.
2d867a2
to
b812265
Compare
@dhh conflicts resolved, buildkite passed, waiting on approval for rest of workflow. Happy to help! Love this this project and community! |
Awesome, @spinosa. Will get this validated in one of our apps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work @spinosa!
@spinosa Up for doing a backport to 6-1-stable as well? |
* main: (78 commits) Update MessageEncryptor guide to show that an exception is raised Depend on Zeitwerk 2.5.0.beta5 Fix wrong RDoc Add `partial_inserts` default configuration for Rails 7.0 in guides/source/configuring.md Improves ActionView FormHelper check_box documentation Update .github/pull_request_template.md Warning about draft PRs Add changelog entry for #42501 Fix codespell `hiearchy ==> hierarchy` error. Replace the word dumb with naive for clarity and inclusivity More example in the docs about STI and autoloading Client ensures subscribe command is confirmed. (#41581) Document easier way to preload STIs Revert "Fix ForkTracker on ruby <= 2.5.3" Don't override Object#fork in Ruby 3.0 Fix default scope with all_queries on reload test name Use regular memoization Avoid class_attrs for unused collection callbacks Accept optional transaction args to #with_lock Append trailing slash when the path is generated ...
Backport to 6-1-stable: |
Summary
A SubscriptionGuarantor maintains a set of pending subscriptions,
resending the subscribe command unless and until the subscription
is confirmed or rejected by the server or cancelled client-side.
A race condition in the ActionCable server - where an unsubscribe
is sent, followed rapidly by a subscribe, but handled in the reverse
order - necessitates this enhancement. Indeed, the subscriptions created
and torn down by Turbo Streams amplifies the existence of this race
condition.
Other Information
The effects of the race condition have also been documented in #38668
Fixes #38668