Skip to content
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

Implement sending bulk notifications #26

Merged
merged 4 commits into from
Dec 29, 2022

Conversation

mohammadranjbarz
Copy link
Contributor

related to #24

@mohammadranjbarz mohammadranjbarz marked this pull request as ready for review December 27, 2022 13:21
Copy link
Member

@aminlatifi aminlatifi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mohammadranjbarz , It looks good.
Just one concern must be addressed, mentioned in another comment

const { microService } = params;
try {
validateWithJoiSchema(body, sendBulkNotificationValidator);
await Promise.all(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if two events have the same trackId? We have made that field unique in the schema, so normally it must throw an error! but the problem is that some notifications will be created and some not!
@mohammadranjbarz Can you write a test to examine it?
If you agree with to change it, the best way in my view is to put all tackIds in a Set and compare its size with the notifications size.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, only duplicates in current notifications may cause a problem. If we have a trackId saved before this request, it will only gracefully ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aminlatifi , your suggestion was good, I did it.

@aminlatifi aminlatifi merged commit 1a04452 into staging Dec 29, 2022
@aminlatifi aminlatifi deleted the f_24_send_bulk_notifications branch December 29, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants