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

Notification inconsistency in recurring calendar events #190

Open
isuru89 opened this issue Aug 28, 2024 · 5 comments
Open

Notification inconsistency in recurring calendar events #190

isuru89 opened this issue Aug 28, 2024 · 5 comments
Assignees
Labels

Comments

@isuru89
Copy link
Owner

isuru89 commented Aug 28, 2024

Describe the bug (required)
As quoted from other issue #184 (comment)

I have identified a few NEW ISSUES related to this same issue, which are outlined below:

When a particular event in a series is deleted, two separate emails are sent to the customer: one stating that the event has been removed, and another indicating that the event has been updated with the date and time of the next occurrence in the series which may not be the next occurrence of that particular event because sometimes we will be scheduling an event later so the second event updated email is unnecessary.

Secondly, no email notifications are sent when an event is updated or deleted within a series that was once either updated or deleted before.

A notification happens again if we delete the event in which an updated notification was received while deleting in the first place, which I mentioned in the first issue.

Also a notification is sent again if the first event that was updated is updated multiple times. However, aside from these two scenarios, no email notifications are sent after an update or removal notification has been received for a particular recurring series once.

I also noticed that there is a delay in updation or deletion if we update a series that has a lot of recurring events in the series, that means the separate notifications are created in the background but the only thing is that the emails are not getting sent.

To Reproduce (required)
Steps to reproduce the behavior:

Mentioned in original quote.

Expected behavior (required)
Notifications on recurring events should process correctly.

Cron Logs
No cron logs are available for calendar events right now.

Environment (required):

  • Moodle version: 4.4
  • Database: mysql
  • PHP Version: 8.2
@flowersofpepper
Copy link

@isuru89 Any update on this?

@isuru89
Copy link
Owner Author

isuru89 commented Dec 28, 2024

@flowersofpepper Please let me reproduce and find a solution for these after the holiday period. Thank you for reminding me about this.

@flowersofpepper
Copy link

@flowersofpepper did you check it? Thank you

@isuru89
Copy link
Owner Author

isuru89 commented Feb 5, 2025

@flowersofpepper I actually had a time to investigate this during last weekend. I did not had a chance to reproduce all of them, but please kindly allow me to process them one by one. There are couple of things I would like to mention regarding calendar change notifications in general.

When a particular event in a series is deleted, two separate emails are sent to the customer: one stating that the event has been removed, and another indicating that the event has been updated with the date and time of the next occurrence in the series which may not be the next occurrence of that particular event because sometimes we will be scheduling an event later so the second event updated email is unnecessary.

The plugin has subscribed to Moodle calendar event adds/edits/deletions, and they are stateless invocations in the plugin. That means, plugin does send notifications on-the-fly for each event without knowing about other invocations. Therefore, if the Moodle core is triggering two events to the plugin, then this is currently how it works with the current design of the plugin. I may need to rethink about the existing design (moving to an asynchronous processing) considering the performance issue mentioned as the last point.

Secondly, no email notifications are sent when an event is updated or deleted within a series that was once either updated or deleted before.

A notification happens again if we delete the event in which an updated notification was received while deleting in the first place, which I mentioned in the first issue.

Also a notification is sent again if the first event that was updated is updated multiple times. However, aside from these two scenarios, no email notifications are sent after an update or removal notification has been received for a particular recurring series once.

These are side-effects related to a fix I have done to to #184 (original issue you raised). But, Let me think how both can be resolved.

I also noticed that there is a delay in updation or deletion if we update a series that has a lot of recurring events in the series, that means the separate notifications are created in the background but the only thing is that the emails are not getting sent.

I did not notice this in my local development, which is obviously has very little dataset compare to an actual production environment. However, as I said, the asynchronous processing within the plugin may help to increase the performance.

@flowersofpepper
Copy link

@isuru89 That's awesome, brother, take your time. You are doing a great work. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants