breamware/sidekiq-batch

Non-safe JSON arguments Sidekiq warning

ya2kleet opened this issue · 3 comments

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

Hey @ya2kleet a PR with fixes is really welcome

@nglx done, feel free to review :)

nglx commented

Thanks @ya2kleet