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

Add notifcation logic for OrcaHello subscribers #188

Open
4 tasks
scottveirs opened this issue Sep 18, 2024 · 1 comment
Open
4 tasks

Add notifcation logic for OrcaHello subscribers #188

scottveirs opened this issue Sep 18, 2024 · 1 comment
Assignees
Labels
2024-hackathon Goals or issues for the 2024 annual Microsoft hackathon notification system Issues relating to the notification system

Comments

@scottveirs
Copy link
Member

For OrcaHello subscribers who want to take "protection opportunities" we would like customized emails to be sent.

Problem statement

Previously, an email was sent via SendGrid every time a candidate was approved by a moderator. This can result in the subscribers getting an email as frequently as every minute or so -- which for some may be annoying.

A proposed improvement would use the less expensive AWS SES service discovered by @skanderm and used for notifying moderators of human detections and the ~4,000 member list of Concerned Community Scientists and meet the following requirement for subscriber notifications:

  • No more than 1 email every 15 minutes per hydrophone location
  • Notifications only if a candidate has been moderated as a true positive
  • Notifications only if a candidate is not old (i.e. >1 day since detections occurred)

Proposed solution:

Implement this logic within the OrcaHello Notification system code:

  1. Upon moderation of a candidate that confirms the OrcaHello model successfully detected SRKW calls, send an email to the subscriber list
  2. Note the detection time of the moderated candidate that trigged the notification.
  3. Using the value from step 2, monitor the queue of new candidates, computing the age of each (i.e. subtract new-confirmed-candidate-datetime from the `most-recent-co
  4. If the age of a new true postitive (confirmed candidate) is greater than 15 minutes (AND the age is not negative) then send a new email to the subscriber list. Negative times would indicate a moderator has processed part of the back-log (often many days or months old), in which case no notifications should be sent.

Be sure to throttle the send rate to stay below ~14 emails/sec.

Final steps:

  • Scott and Dave update the list of test-subscribers (~10)
  • Raj and Skander test that the emails send in accordance with the new logic
  • Scott and Dave add to the subscriber list the other end-users who want to take "protection opportunities"
@scottveirs scottveirs added notification system Issues relating to the notification system 2024-hackathon Goals or issues for the 2024 annual Microsoft hackathon labels Sep 18, 2024
@scottveirs
Copy link
Member Author

@dbainj1 and @veirs -- would welcome your input on the proposed solution and its logic...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024-hackathon Goals or issues for the 2024 annual Microsoft hackathon notification system Issues relating to the notification system
Projects
Status: No status
Development

No branches or pull requests

2 participants