-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add missing properties to EventTo #81
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any changes to the tests. Have you run them and checked they still pass. Does it need more tests.
I am particularly concerned about a field called Data with an object type and with no tests to show that this actually works and whether there is the need for serialisers.
I updated the type of Data to Also running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test, the use of the dynamic property looks like arbitrary data is always supplied. I don't understand why you have chosen this data and what it is trying to express.
- Why is it only on the Update and not a create?
- I don't see any documentation links back to where this is explained in the documentation—why is it snake case caps (for example)
I added a test for Create too. It passes but I actually don't know if it tests the right thing. The behavior for creating a subscriber when triggering an event that contains subscriber contact information is described here https://docs.novu.co/subscribers/subscribers#2-inline-of-trigger |
@adelinn thanks for the next move—I hope this isn't delaying a production environment release. A couple of things as I look across the project:
There is one thing to note that IMO is important. This SDK is trying to build a client binding that is understandable inside a code base rather than simply be a direct binding to the http interfaces. It requires a bit of work from our side. |
I'm giving up on it, me and a colleague spent a few hours today trying to understand how the tests work and why it doesn't update the subscriber data and we weren't able to fix it so I just fall backed to If this isn't enough for merge, I'm fine with anyone using my code however they want. |
The problem is that the "Acknowledged" does not yet mean that the data has been updated, the update of subscriber seems to happen later, if you put a |
Hey, sorry it is so hard for you. This testing is hard (for me too) and brittle but once you get it lined up it works for everyone. I am really happy to provide really specific guidance if you show me test data and errors. As an aside, I am trying to get back to the code to roll out all the changes. I apologise. |
"work" in inverted commas. Delays in tests and code lead to pain. Semantically it sounds like an HTTP 202 and will need retries. Any chance of returning the canonical resource? |
But anyways, does the code in this PR really need tests? This is the trigger event endpoint of the SDK, should it care whether the event succeeded or not as long as it was triggered? If yes, that would be kind of out of the scope of this PR since this PR only adds additional properties to the EventTo record. Maybe a test to check if the record is serializable should be made, but there are already other tests that prove that (e.g. the tests for Subscriber endpoints). |
We need this SDK to send some notifications to a large number of subscribers. Before sending we check if each subscriber that we want to send to exists and we create it if not. This means we make large number of unnecessary API calls to Novu since it already does that when triggering an event...