[#190] Scheduled notifications calculate recipients immediately #191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Please provide a summary of the pull request and the issue it resolves. Please add necessary details, context, dependencies, explanation of when review is needed (see next section), etc.
Hi @petyos, we ran into this issue when attempting to use the scheduled notifications for one of our customers so I thought I would open a PR on the main repo too. At a high level I am trying to delay calculating the list of recipients for a scheduled notification until it is time to send out the notification rather than right when it is first scheduled.
To do this, I created a new type of queue item that does not contain recipient details but has a flag instead telling the queue to compute the topic/criteria recipients for the notification when the queue item is processed. It will then insert all of the normal queue items and recipient data and retrigger the queue.
No rush as I have already merged these changes into our fork, but let me know if you have any questions or see any issues when you get a chance. Thanks!
Resolves #190
Review Time Estimate
Please give your idea of how soon this pull request needs to be reviewed by selecting one of the options below. This can be based on the criticality of the issue at hand and/or other relevant factors.
Type of changes
Please select a relevant option:
Checklist:
Please select all applicable options: