Improve photo and timezone sync scheduled task#3208
Open
weilai-irl wants to merge 1 commit into
Open
Conversation
weilai-irl
commented
Jun 4, 2026
Collaborator
- Better support for site not using UPN as username,
- Reduce DB queries.
There was a problem hiding this comment.
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
objectidinstead ofo365name/UPN. - Add photo hash caching in
user_preferencesto skipprocess_new_iconwhen 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.
83a1897 to
e5c849e
Compare
…r site not using UPN as username, reduce DB queries
e5c849e to
c940705
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.