Skip to content

fix: login service configuration notifier event#33410

Draft
ricardogarim wants to merge 2 commits into
developfrom
fix/loginServiceConfiguration-oauth-event
Draft

fix: login service configuration notifier event#33410
ricardogarim wants to merge 2 commits into
developfrom
fix/loginServiceConfiguration-oauth-event

Conversation

@ricardogarim

@ricardogarim ricardogarim commented Oct 1, 2024

Copy link
Copy Markdown
Member

As per OPI-39, we've identified scenarios where a "no broker set to broadcast" message appears, particularly in the "watch.loginServiceConfiguration" event. After reviewing the root cause, we've determined that it's unnecessary to stream changes in real-time through the socket when the server checks for updates to OAuth provider configurations.

@dionisio-bot

dionisio-bot Bot commented Oct 1, 2024

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Oct 1, 2024

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1638336

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Oct 1, 2024

Copy link
Copy Markdown
Contributor
PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-33410/
on branch gh-pages at 2024-10-09 23:01 UTC

@ricardogarim ricardogarim force-pushed the fix/loginServiceConfiguration-oauth-event branch from d173b7a to 1cb7dc9 Compare October 1, 2024 14:32
@codecov

codecov Bot commented Oct 1, 2024

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.55%. Comparing base (bcacbb1) to head (1638336).
⚠️ Report is 3044 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #33410      +/-   ##
===========================================
- Coverage    58.58%   58.55%   -0.03%     
===========================================
  Files         2737     2737              
  Lines        65757    65781      +24     
  Branches     14825    14831       +6     
===========================================
- Hits         38521    38520       -1     
- Misses       24457    24482      +25     
  Partials      2779     2779              
Flag Coverage Δ
unit 67.12% <16.66%> (+3.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ricardogarim ricardogarim marked this pull request as ready for review October 1, 2024 15:39
@ricardogarim ricardogarim requested a review from a team as a code owner October 1, 2024 15:39

@matheusbsilva137 matheusbsilva137 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add a changeset to this PR

Comment thread apps/meteor/server/lib/oauth/updateOAuthServices.ts

@pierre-lehnen-rc pierre-lehnen-rc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

commented under matheus' previous comment.

const item = await LoginServiceConfiguration.findOneById<Omit<LoginServiceConfigurationData, 'secret'>>(_id, {
projection: { secret: 0 },
});
if (!item) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this check will prevent this function from working for removed items

if (oAuthServices.status === 'fulfilled') {
await Promise.all(
oAuthServices.value.map((service) =>
notifyOnLoginServiceConfigurationChangedById(service._id, service.deleted ? 'removed' : 'inserted'),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

previously we always sent updated instead of inserted.. not sure which one is the correct one though

@ricardogarim ricardogarim marked this pull request as draft January 19, 2026 23:23
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.

4 participants