docbrown/app/services/notifications
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
..
milestone Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
moderation Rename User.dev_account to User.staff_account (#14321) 2021-07-26 10:46:26 -04:00
new_badge_achievement Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
new_comment app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
new_follower Adding lightweight structure .coerce methods (#16249) 2022-01-24 11:32:19 -05:00
new_mention app/services i18n (#16189) 2022-01-20 09:25:25 -05:00
notifiable_action Don't notify authors about own org posts (#15113) 2021-10-19 21:32:44 +07:00
reactions Adding lightweight structure .coerce methods (#16249) 2022-01-24 11:32:19 -05:00
tag_adjustment_notification Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
welcome_notification Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
moderation.rb Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121) 2021-07-08 09:31:34 -05:00
remove_all.rb Fix notifications not deleting because mentions already destroyed (#14987) 2021-10-14 09:41:10 -06:00
remove_all_by_action.rb Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00
update.rb Fix app/services' ruby 2.7 kwargs warnings (#13177) 2021-04-01 18:40:50 -04:00