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

[MM-57821] Reduce number of calls to GetUser in syncUsers #620

Merged
merged 1 commit into from
Apr 24, 2024
Merged

Conversation

JulienTant
Copy link
Member

Summary

We are calling GetUser for each synthetic during the syncUsers job, but we only need to make this call if autopromote is on.

Reminder: the reason why we need this call is because GetUsers does not return AuthData: it's sanitized, so we make GetUser to get this info. Ideally, plugins should have access to more unsanitized data, but it involves a much heavier change on mattermost server, getting security validation etc... the change is probably not worth investing time in right now.

I don't expect this PR to have a significant positive perf impact as Jesus believes that GetUser is pulling data from cache rather than DB, but it's probably still better to only do the call when needed rather than all the time.

QA

I think for QA, just making sure that the syncUsers job will works as before is the best way to go

Ticket Link

https://mattermost.atlassian.net/browse/MM-57821

@JulienTant JulienTant added 2: Dev Review Requires review by a core committer 3: QA Review Requires review by a QA tester labels Apr 23, 2024
Copy link
Member

@lieut-data lieut-data left a comment

Choose a reason for hiding this comment

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

Thanks, @JulienTant!

@lindy65 lindy65 added QA/Deferred Agreement with QA that these changes will be tested post-merge and removed 3: QA Review Requires review by a QA tester labels Apr 23, 2024
Copy link

@lindy65 lindy65 left a comment

Choose a reason for hiding this comment

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

Thanks @JulienTant - I've QA-deferred and will test post-merge

Copy link
Contributor

@enahum enahum left a comment

Choose a reason for hiding this comment

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

Yup makes sense

@enahum enahum added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer labels Apr 23, 2024
@JulienTant JulienTant merged commit 187b07f into main Apr 24, 2024
7 checks passed
@JulienTant JulienTant deleted the MM-57821 branch April 24, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4: Reviews Complete All reviewers have approved the pull request QA/Deferred Agreement with QA that these changes will be tested post-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants