After looking at raw data in the database and on the notifications history page for a participant with this issue:
participant id 966u1cd7 on staging
Events just stop for both (there are 2) weekly surveys.
Then one of the surveys starts working again.
We don't think there is an error in the query into scheduled events, that code has been stable.
unfortunately this was on our staging server and there was a lot of churn going on literally in the file and on the server; it could just be bad luck interacting with that.
todo:
make a task that resets all weekly schedule surveys.... daily. this will solve the situation where somehow the get_next_weekly_event_and_schedule is wrong, petentially because it doesn't handle timezones.
this code should report an error whenever the scheduledevents it creates differ from the prior state of the database.
review get_next_weekly_event_and_schedule for possible timezone bugs, determine how those would/could manifest.
write a bunch of tests.
fix the ~bug where schedules get purged and recreated when editing a survey - does this apply to all schedule types?
After looking at raw data in the database and on the notifications history page for a participant with this issue:
todo:
get_next_weekly_event_and_schedule
is wrong, petentially because it doesn't handle timezones.get_next_weekly_event_and_schedule
for possible timezone bugs, determine how those would/could manifest.