-
Notifications
You must be signed in to change notification settings - Fork 330
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
Failed enqueuing Turbo::Streams::BroadcastStreamJob to Sidekiq(default): ArgumentError (Job arguments to Turbo::Streams::BroadcastStreamJob must be native JSON types, but "<turbo-stream action=\"refresh\"></turbo-stream>" is a ActiveSupport::SafeBuffer. #535
Comments
Is this a duplicate of #522? |
Maybe it's related, but It's a different error message. |
It's the same underlying problem - |
I am getting the same error. Running rails edge as recommended in #522 did not fix the issue for me. It does not seem to be the exact same issue but separate. Gemfile:
|
@drale2k thank you for double-checking. This is likely the same type of error as the Active Job variation, but specifically to Sidekiq's Active Job adapter. |
I am getting the same error when updating a Rails model with the rails 7.1.2 any ideas? Edit: Adding |
Rather than just disabling sidekiq's args-checking, another alternative might be to add this monkeypatch in an initializer: Rails.application.config.after_initialize do
Turbo::Streams::BroadcastStreamJob.class_eval do
def self.perform_later(stream, content:)
super(stream, content: content.to_str)
end
end
end |
This provides compatibility with Sidekiq as an ActiveJob adapter (because [Sidekiq only allows native JSON types][1] to be passed as job arguments). All credit goes to [@jdelStrother] who [suggested this solution][2]. Fixes [hotwired#522] and [hotwired#535] [1]: https://github.com/sidekiq/sidekiq/wiki/Best-Practices#1-make-your-job-parameters-small-and-simple [2]: hotwired#535 (comment) [@jdelStrother]: https://github.com/jdelStrother [hotwired#522]: hotwired#522 [hotwired#535]: hotwired#535
I got this error when I updated the record.
Profile.find(1).update(column: true)
Gemfile
Active record
The text was updated successfully, but these errors were encountered: