breamware / sidekiq-batch

Sidekiq Batch Jobs Implementation
MIT License
357 stars 95 forks source link

Non-safe JSON arguments Sidekiq warning #56

Closed ya2kleet closed 2 years ago

ya2kleet commented 2 years ago

Sidekiq ~> 6 warns about passing non-safe JSON arguments to jobs via this message:

Job arguments to #{item["class"]} do not serialize to JSON safely. This will raise an error in Sidekiq 7.0. See https://github.com/mperham/sidekiq/wiki/Best-Practices or raise an error today by calling Sidekiq.strict_args! during Sidekiq initialization.

Moreover, as you can see, Sidekiq ~> 7 will raise an error (it already does if Sidekiq.raise_args! is invoked) This gem, unfortunately, pushes some symbols instead of strings (e.g. ./sidekiq/batch:176). It can be resolved by forcibly converting events names (e.g. :complete) to string If that's an issue, I'd like to propose a PR (if required)

nglx commented 2 years ago

Hey @ya2kleet a PR with fixes is really welcome

ya2kleet commented 2 years ago

@nglx done, feel free to review :)

nglx commented 2 years ago

Thanks @ya2kleet