docbrown/spec
Daniel Uber 4b4d8a7234
Ensure arguments to perform_async are json safe (#16285)
* Convert symbol hash keys to strings when calling .perform_async

Fixes a warning from Sidekiq 6.4.0+ about perform_async arguments
which are not equal when passed to perform (`JSON.parse(JSON.dump(arg))`
should equal arg).

This is a safety measure to prevent passing objects (like classes, or
model instances) rather than their representations (like a class name,
or a model's attributes hash).

This warning will be an error in sidekiq 7

* Turn warning into an error in non-production environments

* Use string keys for reaction notification and article fetched

Missed these two on the first pass

* Update example argument hashes for #enqueues_on_correct_queue

Since this calls perform_async under the hood we need to pass json
safe hashes in the test cases as well.

https://github.com/forem/forem/blob/main/spec/workers/shared_examples/enqueues_on_correct_queue.rb

* Convert keys from FollowData#to_h to string before perform_async

I'm not sure enough where else (outside of notification) to_h is being
called, so I'm converting here when building args, rather than in
FollowData#to_h, which might be my next step.

* Let FollowData#to_h return a hash with string keys

Update spec to use string keys as well.

* Make to_h return string keys for ReactionData

Like FollowData, the #to_h method is only used to call
notifications (this is used to enqueue sidekiq jobs).

* Remove a key that was in the hash

Since reaction_data calls to_h, it gets string and not symbol,
keys. Call Hash#except with a key that was actually there.
2022-01-25 18:07:40 -06:00
..
components/admin/users Refactor Admin Member Detail view - Tools section (#14283) 2021-08-17 18:55:53 +02:00
controllers/concerns 15 minute fix: Add default argument to JsonApiSortParam (#13369) 2021-04-14 10:32:07 +07:00
decorators Refactoring cached_followed_tags (#16175) 2022-01-24 19:53:48 -05:00
factories Constantize broadcast messages (#16219) 2022-01-20 11:47:01 -06:00
fixtures Remove duplicated work display from header / profile work (#14210) 2021-07-30 12:28:40 +02:00
forms Clear changes to settings after checking form saves them (#15746) 2021-12-14 08:39:14 -06:00
generator Add service generator (#11265) 2020-11-10 09:09:35 +07:00
helpers Update crayons_icon_tag helper (#16099) 2022-01-14 17:14:42 +07:00
initializers ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
lib Stripping tags from "tags.short_summary" column (#16248) 2022-01-21 09:38:26 -05:00
liquid_tags Added title to be displayed for stackexchange question (#16289) 2022-01-25 13:24:03 -06:00
mailers Prefer custom SMTP config over Sendgrid (#16216) 2022-01-24 14:11:50 -05:00
models Let's be friends again, Rubocop (#16294) 2022-01-25 11:58:00 -05:00
policies Prevent banished users from updating their profiles (#16122) 2022-01-17 10:54:02 -05:00
queries Fixes a name conflict in Rpush models (#15978) 2022-01-07 09:38:16 -06:00
refinements Update data exporter to handle admin send (#10274) 2020-10-26 18:00:56 -04:00
requests Onboarding "improvements" (#16210) 2022-01-21 10:58:05 -06:00
routing ✂✂✂ Remove shop_url from SiteConfig ✂✂✂ (#13773) 2021-05-18 09:03:05 +07:00
serializers Refactoring to add helper method (#16064) 2022-01-12 11:21:44 -05:00
services Ensure arguments to perform_async are json safe (#16285) 2022-01-25 18:07:40 -06:00
support Prefer custom SMTP config over Sendgrid (#16216) 2022-01-24 14:11:50 -05:00
system Remove the "Getting Started" Section from the Config (#16033) 2022-01-20 07:31:35 -07:00
tasks Create Default Nav Links In New Forem (RFC #237) (#14345) 2021-08-02 12:52:36 -04:00
uploaders Data Update Script to migrate logo_svg contents to png file (Will be merged and deployed on 10/01) (#15710) 2022-01-10 16:09:34 +02:00
validators Don't raise error when empty community emoji setting submitted (#15723) 2021-12-17 09:29:55 -06:00
view_objects Patching ERB rendering of the data-info JSON (#16067) 2022-01-14 08:30:49 -05:00
views quote localized strings in credits/purchase embedded script (#15623) 2021-12-01 10:07:55 -06:00
workers Ensure arguments to perform_async are json safe (#16285) 2022-01-25 18:07:40 -06:00
i18n_spec.rb Misc i18n fixes (#14852) 2021-10-05 13:22:33 +02:00
rails_helper.rb Let's be friends again, Rubocop (#16294) 2022-01-25 11:58:00 -05:00
spec_helper.rb Theme data update script, remove theme choices from UI (#15225) 2021-11-08 08:38:43 -05:00