Skip to content

Fix realtime subscriptions - #2

Merged
cardmagic merged 1 commit into
mainfrom
agent/fix-realtime-subscriptions
Aug 7, 2026
Merged

Fix realtime subscriptions#2
cardmagic merged 1 commit into
mainfrom
agent/fix-realtime-subscriptions

Conversation

@cardmagic

Copy link
Copy Markdown
Owner

Summary

  • load SolidObjects::ActorChannel through the normal gem entry point
  • emit stream and component credentials as Turbo-compatible data-* attributes
  • exercise rendered scalar and component subscriptions through the Action Cable channel harness
  • document the fix for a proposed 0.4.1 patch release

Root cause

Turbo Rails 2.0.23 constructs custom channel parameters from the element's dataset. Solid Objects 0.4.0 rendered a plain token attribute, so the browser omitted it from the subscription identifier and ActorChannel rejected the missing token. The channel class also lived under lib/ without being required by solid_objects.

Behavior

Scalar and component subscriptions now pass token and optional components parameters to SolidObjects::ActorChannel. Existing authorization rejection, invalid-token handling, durable broadcasts, and reconnect revision fencing remain unchanged.

No database migration is required.

Validation

  • bundle exec ruby -Itest test/integration/engine_test.rb
  • bundle exec ruby -Itest test/integration/actor_helper_test.rb
  • bundle exec ruby -Itest test/integration/actor_channel_test.rb
  • bundle exec rake — 210 tests, 819 assertions; Standard, RuboCop, RBS, Steep, and Brakeman passed

Load the actor channel with the gem and expose stream credentials as Turbo data attributes so Action Cable receives them. Exercise rendered scalar and component subscriptions through the channel harness.
@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown

Greptile Summary

The PR repairs realtime subscriptions by loading SolidObjects::ActorChannel from the gem entry point and rendering credentials as Turbo-compatible data-* attributes.

  • Moves stream and component credentials into the element dataset consumed by Turbo Rails.
  • Adds integration coverage for rendered scalar and component subscriptions.
  • Adds a boot assertion and documents the pending patch.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete blocking or non-blocking defects identified in the changed code.

The helper now emits the parameter shape expected by Turbo, the channel is loaded from the gem entry point, and the added integration coverage exercises both scalar and component subscription paths.

Important Files Changed

Filename Overview
app/helpers/solid_objects/actor_helper.rb Renders token and optional component credentials through Rails’ data: attribute serialization while keeping the channel identifier unchanged.
lib/solid_objects.rb Loads the actor channel through the normal gem entry point.
lib/solid_objects/actor_channel.rb Loads Action Cable’s public entry point before defining the channel; subscription authorization and validation behavior remain unchanged.
test/integration/actor_channel_test.rb Adds end-to-end helper-to-channel coverage for scalar and component subscription parameters.
test/integration/actor_helper_test.rb Updates rendered-markup assertions to require dataset-backed credentials and reject the former plain token attribute.

Reviews (1): Last reviewed commit: "fix: restore realtime subscriptions" | Re-trigger Greptile

@cardmagic
cardmagic marked this pull request as ready for review August 7, 2026 02:49
@cardmagic
cardmagic merged commit 3a88b73 into main Aug 7, 2026
11 checks passed
@cardmagic
cardmagic deleted the agent/fix-realtime-subscriptions branch August 10, 2026 13:52
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.

1 participant