Skip to content

Improve photo and timezone sync scheduled task#3208

Open
weilai-irl wants to merge 1 commit into
MOODLE_405_STABLEfrom
wip-130227-m405
Open

Improve photo and timezone sync scheduled task#3208
weilai-irl wants to merge 1 commit into
MOODLE_405_STABLEfrom
wip-130227-m405

Conversation

@weilai-irl

Copy link
Copy Markdown
Collaborator
  • Better support for site not using UPN as username,
  • Reduce DB queries.

Copilot AI review requested due to automatic review settings June 4, 2026 09:35
@weilai-irl weilai-irl self-assigned this Jun 4, 2026
@weilai-irl weilai-irl added this to the 2026-03 milestone Jun 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Improves the scheduled photo/timezone sync task in local_o365 by using Azure AD objectid for Graph photo requests (to better support non-UPN usernames) and by reducing per-user work/queries during photo application.

Changes:

  • Fetch photos in batches keyed by Azure AD objectid instead of o365name/UPN.
  • Add photo hash caching in user_preferences to skip process_new_icon when the raw photo hasn’t changed.
  • Update apply_photo* flow to return a boolean and detect photo content changes via file content hashes (rather than picture ID comparisons).

Reviewed changes

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

File Description
local/o365/classes/task/photoandtimezonesync.php Switch photo identifier to objectid, reduce DB work via joins + preference hash caching, and apply photos more selectively.
local/o365/classes/feature/usersync/main.php Improve photo apply semantics: return bool, clear-photo result correctness, and content-change detection via file hashes.

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

Comment thread local/o365/classes/task/photoandtimezonesync.php Outdated
Comment thread local/o365/classes/task/photoandtimezonesync.php Outdated
Comment thread local/o365/classes/task/photoandtimezonesync.php Outdated
…r site not using UPN as username, reduce DB queries
@weilai-irl weilai-irl changed the title Improve photo sync in scheduled task Improve photo and timezone sync scheduled task Jun 4, 2026
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 participants