docbrown/app/services
Jeremy Friesen 24ccc5ac06
Adding lightweight structure .coerce methods (#16249)
I saw the following error in Honeybadger:

```
[PROJECT_ROOT]/app/services/notifications/reactions/send.rb:61 :in `call`

    old_json_data = notification.json_data
    previous_siblings_size = notification.json_data["reaction"]["aggregated_siblings"].size if old_json_data

	notification.json_data = json_data
[PROJECT_ROOT]/app/services/notifications/reactions/send.rb:20 :in `call`
[PROJECT_ROOT]/app/workers/notifications/new_reaction_worker.rb:16 :in `perform`
[PROJECT_ROOT]/app/models/notification.rb:84 :in `send_reaction_notification_without_delay`
[PROJECT_ROOT]/app/controllers/reactions_controller.rb:136 :in `destroy_reaction`
[PROJECT_ROOT]/app/controllers/reactions_controller.rb:168 :in `handle_existing_reaction`
[PROJECT_ROOT]/app/controllers/reactions_controller.rb:77 :in `create`
```

As I was exploring the error, I saw that we were making assumptions
about the data coercion.  These are valid and somewhat stable
assumptions, but I wanted to look a little deeper into the situation.

This refactor helps consistently negotiate two situations where we're
transforming request-cycle models into lightweight data structures.  It
also begins to show a path towards a generalizable "macro" for this behavior.

Related to #2122, #9534
2022-01-24 11:32:19 -05:00
..
articles Explicitly silence FastImage exceptions (#16176) 2022-01-19 08:56:26 -05:00
audit Rubocop fixes (#11862) 2020-12-11 17:36:42 +03:00
authentication app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
badges app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
broadcasts/welcome_notification app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
color Color tokens (#16107) 2022-01-21 07:41:03 +01:00
credits Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
discover Add Forem Discover registration worker and service (#14865) 2021-10-01 10:27:31 -04:00
edge_cache ✂✂✂ Remove events (#15062) 2021-10-15 09:31:08 -04:00
error_messages app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
exporter Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
fastly_config Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
feeds app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
follows Fix UI showing "Following" after unfollowing a user (#13757) 2021-05-19 17:40:38 +01:00
giphy
github Spelling (#15702) 2021-12-07 06:59:10 -07:00
homepage Extracting duplicate logic (#16035) 2022-01-10 15:19:04 -05:00
html app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
images Addressing rubocop violations (#16156) 2022-01-17 17:21:06 -05:00
listings ListingsToolkit refactoring (#16184) 2022-01-21 09:27:10 +07:00
loggers Rubocop fixes (#15892) 2021-12-28 09:11:41 -06:00
mailchimp app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
markdown_processor app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
mentions Issue #9077 has already been resolved, added specs (#15342) 2021-11-17 11:27:50 +02:00
moderator app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
notification_subscriptions Add Article post_commit when user_id changes with specs (#15132) 2021-10-25 10:53:21 +07:00
notifications Adding lightweight structure .coerce methods (#16249) 2022-01-24 11:32:19 -05:00
organizations Organizations delete optimizations and refactoring (#13610) 2021-05-11 12:14:55 +03:00
payments app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
podcasts views/podcasts, views/podcast_episodes i18n (#15020) 2021-10-25 14:32:51 +01:00
profile_fields Refactor profile refreshing (#14643) 2021-09-13 12:15:04 -04:00
push_notifications Have specs run without Redis and refactor ConsumerApp and Device (#13647) 2021-05-07 08:03:16 +02:00
re_captcha Spelling fixes to live code (#15670) 2021-12-06 12:11:25 +02:00
search Include badge before serializing (#16160) 2022-01-17 17:12:52 -06:00
settings Addressing rubocop violations (#16156) 2022-01-17 17:21:06 -05:00
slack app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
spam app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
tag_moderators Refactoring questions asked of user (#15762) 2021-12-21 12:45:12 -05:00
twitter_client Split Settings::Authentication from SiteConfig (#13095) 2021-04-12 09:41:09 +02:00
user_subscriptions app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
users app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
analytics_service.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
application_service.rb
article_api_index_service.rb Factoring code to define Article.approved (#15600) 2021-12-01 22:45:32 -05:00
article_with_video_creation_service.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
bulk_sql_delete.rb Remove txn from with_statement_timeout block (#15088) 2021-10-15 14:53:35 -04:00
email_digest.rb Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121) 2021-07-08 09:31:34 -05:00
email_digest_article_collector.rb Extracting a not_authored_by scope (#16123) 2022-01-17 15:20:49 -05:00
feature_flag.rb Updating documentation on FeatureFlag.accessible? (#15492) 2021-11-29 20:25:17 -05:00
flare_tag.rb [Search 2.0] Homepage query (#13339) 2021-04-21 12:41:24 +02:00
instrumentation.rb Instrument EmailDigestArticleCollector (#13153) 2021-03-29 09:33:32 -04:00
markdown_processor.rb Extracting container for allowed tags & attrs (#15338) 2021-12-16 12:24:45 -05:00
medium_article_retrieval_service.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
notifications.rb
rate_limit_checker.rb app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
tag_adjustment_creation_service.rb
tag_adjustment_update_service.rb