guardian / mobile-notifications-content

Lambda that reads from the content api stream and triggers notifications for followable content
2 stars 0 forks source link

Remove play-json from dependencies #82

Closed aracho1 closed 2 months ago

aracho1 commented 2 months ago

Co-authored-by: @alinaboghiu @rtyley

What does this change?

In the past week, we experienced issues with mobile notifications not being sent out. Logs were indicating void play.api.libs.json.Format.$init$(play.api.libs.json.Format) errors since upgrading the mobile-notifications-api-models library from 1.0.16 to 1.0.18.

@rtyley helpfully pointed out this was due to a conflict in the version of the play-json library that this project is using vs. the version mobile-notifications-api-models library is using. Normally scala would default to using the latest version of the library in case of such conflict but the because the author of this library has changed (com.typesafe.playorg.playframework), it resulted in the conflict.

This PR therefore removes the play-json from the project dependencies as we can import the correct version via the mobile-notifications-api-models library.

How to test

I tested this on CODE by creating a test article on composer CODE. The logs look healthy

Lambda logs&_a=(columns:!(),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:b0be43a0-59d7-11e8-a75a-b7af20e8f748,key:stage,negate:!f,params:(query:CODE),type:phrase),query:(match_phrase:(stage:CODE))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:b0be43a0-59d7-11e8-a75a-b7af20e8f748,key:app,negate:!f,params:(query:mobile-notifications-content),type:phrase),query:(match_phrase:(app:mobile-notifications-content)))),index:b0be43a0-59d7-11e8-a75a-b7af20e8f748,interval:auto,query:(language:kuery,query:''),sort:!(!('@timestamp',desc)))) image

Notification api logs&_a=(columns:!(message),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'26bd67e0-d55e-11e9-923e-49c5b785a0b2',key:app,negate:!f,params:(query:notification),type:phrase),query:(match_phrase:(app:notification))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'26bd67e0-d55e-11e9-923e-49c5b785a0b2',key:stage,negate:!f,params:(query:CODE),type:phrase),query:(match_phrase:(stage:CODE)))),grid:(),hideChart:!f,index:'26bd67e0-d55e-11e9-923e-49c5b785a0b2',interval:auto,query:(language:kuery,query:'%22Notification%20was%20sent%22'),sort:!(!('@timestamp',desc)))) image