Skip to content
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

Support NO_UPDATE in ActionCable subscriptions #3713

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

jqr
Copy link
Contributor

@jqr jqr commented Nov 18, 2021

Looks like this may be the fix for #3189 and similar empty subscription updates I'm seeing in my application.

Applies the same pattern to ActionCableSubscriptions as Subscriptions, which just checks if execute_update returns nil and skips the delivery. See

def execute(subscription_id, event, object)
res = execute_update(subscription_id, event, object)
if !res.nil?
deliver(subscription_id, res)
end
end

Given this is a subclass, I'm guessing there's a better way to rely on the superclass behavior and ensure all subclasses inherit this important feature. Open to suggestions.

@jqr jqr changed the title Support NO_UPDATE from in ActionCable subscriptions Support NO_UPDATE in ActionCable subscriptions Nov 19, 2021
@rmosolgo rmosolgo added this to the 1.13.0 milestone Nov 24, 2021
@rmosolgo
Copy link
Owner

Sorry for my slow response on this. Looks good to me! I think putting this check in the subclass is fine. In practice, different subscription implementations have to manage their own storage and transport, so this check would go somewhere different in each one.

@rmosolgo rmosolgo merged commit ead2598 into rmosolgo:master Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants