Closed paul-ritense closed 3 weeks ago
This ticket was approved by DH so it can be picked up.
@joeribekker Any estimation for when this will be picked up?
It will be discussed tomorrow, I know more by then
So, the tasks here are:
register_kanalen
command work in the Objects API (https://github.com/maykinmedia/objects-api/issues/426)This bug happens because of inconsistency of using camelCase and snake_case in 3 places:
As is:
register_kanalen
management command) it's created with name objecten
and kenmerken ["object_type"]
"filters" : {"objectType": <some-url>}
, the filter will be saved as object_type
"kenmerken": {"objectType": <some-url>}
, because Objects API camelizes the notification message before sending it to Notifications APIAnd then Notifications API can't match abonnement,filters and notification,kenmerken
Possible solutions
Leave everything as it is, and just improve matching in Notifications API, so it could process and compare both camelCase and snake_case. I think it's the easiest solution, which won't affect much.
Make everything cameCase as Joeri suggested. In this case we will have to make quite a lot of changes including data migrations:
["objectType"]
objecten
kanaalWhich one should we choose? @joeribekker @alextreme Could you help me please?
@annashamray considering the impact of Joeri's suggestion lets go with the first solution you suggested.
In the Notifications API when updating an abonnement the key in the filters is stored as snake_case. objectType is stored as object_type, while filtering on objecttype only works with objectType in camelCase. Steps to reproduce:
See an example notifications_API.txt with curl in the attachment.