docbrown/app/controllers
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
..
admin Ensure arguments to perform_async are json safe (#16285) 2022-01-25 18:07:40 -06:00
api/v0 app/controllers/api i18n (#16002) 2022-01-11 10:05:54 +07:00
concerns ListingsToolkit refactoring (#16184) 2022-01-21 09:27:10 +07:00
incoming_webhooks Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121) 2021-07-08 09:31:34 -05:00
notifications Rubocop: fix additional violations in todo file (#9218) 2020-07-09 10:25:44 -04:00
stories Refactor AB Experiments and exercise all variants in rspec (#16236) 2022-01-24 17:03:58 -05:00
users Mobile mention notifications (#15780) 2021-12-16 11:06:54 -06:00
api_secrets_controller.rb Removing Settings::General.email_addresses (#13958) 2021-06-11 12:34:34 +03:00
application_controller.rb Remove Setup Banner (VerifySetupCompleted) (#15969) 2022-01-10 10:30:05 -07:00
application_metal_controller.rb
article_approvals_controller.rb
articles_controller.rb Refactoring to leverage an Article scope (#15850) 2021-12-29 09:25:31 -05:00
async_info_controller.rb Refactoring cached_followed_tags (#16175) 2022-01-24 19:53:48 -05:00
badges_controller.rb
collections_controller.rb Series count to only include non empty series (#16130) 2022-01-18 10:22:34 +07:00
comments_controller.rb Spelling fixes to live code (#15670) 2021-12-06 12:11:25 +02:00
confirmations_controller.rb Redirect to creator settings page where necessary (#15298) 2021-11-11 14:44:49 +02:00
credits_controller.rb Refactor credit purchasing (#13955) 2021-06-15 09:04:51 +07:00
dashboards_controller.rb Series count to only include non empty series (#16130) 2022-01-18 10:22:34 +07:00
deep_links_controller.rb Add exclusion to AASA supported paths (#14593) 2021-08-26 10:17:39 -06:00
devices_controller.rb ForemMobile namespaced functions (#15212) 2021-11-23 15:25:29 -06:00
discussion_locks_controller.rb Update DiscussionLocksController (#14351) 2021-07-27 14:42:14 +02:00
display_ad_events_controller.rb Extracting constants and tidying tests (#15946) 2022-01-05 09:19:39 -05:00
email_authorizations_controller.rb Standardize ActiveRecord order clauses (#9395) 2020-07-20 10:00:51 -04:00
email_subscriptions_controller.rb ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
feedback_messages_controller.rb Remove "connect" feedback message special treatment (#16167) 2022-01-19 08:32:10 -06:00
followings_controller.rb Rubocop: move dot in multi-line calls to leading position (#9262) 2020-07-16 15:51:11 +02:00
follows_controller.rb Bug Fix: Following an organization from article's sidebar creates an incorrect follow record (#15093) 2021-11-05 12:40:20 -04:00
ga_events_controller.rb Skip google analytics when ga_tracking_id is nil (#15967) 2022-01-06 12:21:07 -05:00
github_repos_controller.rb Spelling (#15702) 2021-12-07 06:59:10 -07:00
html_variant_successes_controller.rb
html_variant_trials_controller.rb
image_uploads_controller.rb [deploy] Store Article's main_image path unprocessed (#10867) 2020-10-16 14:46:37 -04:00
invitations_controller.rb Part One: Fix Users Stuck in a "Created" but "Unregistered" State (#10882) 2020-10-19 16:51:31 -04:00
liquid_embeds_controller.rb Move work from template to controller (#16092) 2022-01-18 11:21:25 -05:00
liquid_tags_controller.rb Remove redundant freeze calls (#14596) 2021-08-26 10:01:08 -04:00
listings_controller.rb ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
moderations_controller.rb Refactoring questions asked of user (#15762) 2021-12-21 12:45:12 -05:00
notification_subscriptions_controller.rb Rename unidiomatic methods (#13328) 2021-04-09 10:59:56 -05:00
notifications_controller.rb Refactoring to add helper method (#16064) 2022-01-12 11:21:44 -05:00
omniauth_callbacks_controller.rb Guarding against spam from OAuth Sources (#15404) 2021-11-18 16:26:39 -05:00
onboardings_controller.rb
open_search_controller.rb [deploy] Remove need for ENV vars during asset precompile (#10349) 2020-09-16 13:57:05 -04:00
organizations_controller.rb Use constants for Permitted params in controller (#14895) 2021-10-05 09:00:14 -04:00
page_views_controller.rb Ensuring we don't track views of author or unpublished (#16143) 2022-01-18 11:23:18 -05:00
pages_controller.rb RFC #74, Pt. 2: Private Forem Landing Page (#13819) 2021-06-10 11:46:24 -06:00
passwords_controller.rb Add a notification on password reset (#14968) 2021-10-07 14:48:01 -04:00
podcast_episodes_controller.rb Fix and clean up podcast pages (#15004) 2021-10-15 17:38:57 -04:00
podcasts_controller.rb Use constants for Permitted params in controller (#14895) 2021-10-05 09:00:14 -04:00
poll_skips_controller.rb Use constants for Permitted params in controller (#14895) 2021-10-05 09:00:14 -04:00
poll_votes_controller.rb Use constants for Permitted params in controller (#14895) 2021-10-05 09:00:14 -04:00
pro_accounts_controller.rb
profile_field_groups_controller.rb Add ProfileFieldGroupsController to API (#10124) 2020-09-03 10:12:53 +07:00
profile_pins_controller.rb Favor destroy_by over where.first&.destroy (#15868) 2021-12-22 23:55:52 -05:00
profile_preview_cards_controller.rb Add JSON representation of Profile Preview Card info (#14296) 2021-07-21 16:23:54 +01:00
profiles_controller.rb Profile generalization: cleanup (#12947) 2021-08-20 16:36:02 +02:00
rating_votes_controller.rb [deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
reactions_controller.rb Don't try to create invalid RatingVote (#14706) 2021-09-14 09:41:59 +07:00
reading_list_items_controller.rb [deploy] Fix Reading List Counter Without last_reacted_at Default (#10933) 2020-10-19 13:26:19 -05:00
registrations_controller.rb Adding ability to block domains from registration (#15397) 2021-11-16 18:56:01 -05:00
response_templates_controller.rb Add ApplicationRecord#errors_as_sentence (#8265) 2020-06-04 16:02:41 +02:00
search_controller.rb Spelling (#15702) 2021-12-07 06:59:10 -07:00
service_worker_controller.rb Revert "Revert "Removed service worker (#12974)" (#13014)" (#13015) 2021-03-17 10:57:56 -04:00
sidebars_controller.rb Refactoring to consolidate logic (#15851) 2021-12-29 11:08:04 -05:00
sitemaps_controller.rb Spelling (#15702) 2021-12-07 06:59:10 -07:00
social_previews_controller.rb Rubocop: enable and fix new Rails cops (#9537) 2020-07-29 11:14:19 +02:00
stories_controller.rb Refactoring to add helper method (#16064) 2022-01-12 11:21:44 -05:00
stripe_active_cards_controller.rb Use constants for Permitted params in controller (#14895) 2021-10-05 09:00:14 -04:00
tag_adjustments_controller.rb Fix new Rubocop violations (#10808) 2020-10-20 09:28:53 -04:00
tags_controller.rb Tidying up and documenting Tag model (#15949) 2022-01-07 09:14:31 -05:00
user_blocks_controller.rb ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
user_subscriptions_controller.rb UserSubscription backend refactor (#9060) 2020-07-02 12:08:37 -04:00
users_controller.rb Onboarding "improvements" (#16210) 2022-01-21 10:58:05 -06:00
video_states_controller.rb Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
videos_controller.rb Rubocop: Enable and fix Style/StringConcatenation (#9844) 2020-08-18 14:50:15 +02:00