Skip to content

Comments

Move observer triggered team owner/member sync for individual users to ad-hoc tasks#3041

Open
weilai-irl wants to merge 1 commit intoMOODLE_501_STABLEfrom
wip-126133-m501
Open

Move observer triggered team owner/member sync for individual users to ad-hoc tasks#3041
weilai-irl wants to merge 1 commit intoMOODLE_501_STABLEfrom
wip-126133-m501

Conversation

@weilai-irl
Copy link
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings February 19, 2026 16:44
@weilai-irl weilai-irl self-assigned this Feb 19, 2026
@weilai-irl weilai-irl modified the milestones: 2026-02, 2026-01 Feb 19, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors observer-triggered Microsoft 365 group/team membership synchronization from synchronous inline operations to asynchronous ad-hoc tasks. When Moodle events fire (user enrollment updates, role assignments/unassignments, enrollment instance updates), instead of immediately calling the Microsoft Graph API to sync the user's role in the connected Microsoft 365 group, the code now queues lightweight ad-hoc tasks that execute later.

Changes:

  • Created new ad-hoc task class usergroupmembershipsync that encapsulates single user-course sync logic
  • Updated four observer methods to queue ad-hoc tasks instead of performing synchronous API calls
  • Added language string for the new task

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
local/o365/version.php Incremented plugin version number (contains a critical formatting issue)
local/o365/lang/en/local_o365.php Added language string for the new ad-hoc task
local/o365/classes/task/usergroupmembershipsync.php New ad-hoc task that syncs a single user's role in a course group to Microsoft 365
local/o365/classes/observers.php Refactored four observer methods to queue ad-hoc tasks instead of synchronous sync calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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 minutes of blocked session in browser when enrolling users in course

1 participant