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

Regression: fix directory endpoint not listing teams #26310

Merged
merged 5 commits into from
Jul 20, 2022

Conversation

carlosrodrigues94
Copy link
Contributor

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

@carlosrodrigues94 carlosrodrigues94 changed the title fix: error in list teams [FIX] error in list teams Jul 19, 2022
@matheusbsilva137 matheusbsilva137 changed the title [FIX] error in list teams Regression: fix directory endpoint not listing teams Jul 20, 2022
apps/meteor/server/methods/browseChannels.js Outdated Show resolved Hide resolved
apps/meteor/server/methods/browseChannels.js Outdated Show resolved Hide resolved
@matheusbsilva137 matheusbsilva137 added this to the 5.0.0 milestone Jul 20, 2022
@ggazzo ggazzo added the stat: ready to merge PR tested and approved waiting for merge label Jul 20, 2022
@ggazzo ggazzo requested a review from sampaiodiego July 20, 2022 20:45
});
const getChannelsCountForTeam = mem(
(teamId) => {
return Rooms.findByTeamId(teamId, { projection: { _id: 1 } });
Copy link
Member

Choose a reason for hiding this comment

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

as far as i understand this returns a cursor, cursors are VERY FAST, they only generates a object structure, no cache needed

const teams = [];

for await (const room of rooms) {
const roomsCount = await getChannelsCountForTeam(room.teamId).count();
Copy link
Member

Choose a reason for hiding this comment

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

this count generates a call to the db, it could be cached

apps/meteor/server/methods/browseChannels.js Outdated Show resolved Hide resolved
@sampaiodiego sampaiodiego merged commit 1c8d000 into develop Jul 20, 2022
@sampaiodiego sampaiodiego deleted the FIX/teams_list branch July 20, 2022 23:45
@sampaiodiego
Copy link
Member

that endpoint is missing a test to validate the return of teams.. can either of you @carlosrodrigues94 or @matheusbsilva137 add a test to it pls?

gabriellsh added a commit that referenced this pull request Jul 26, 2022
* 'develop' of github.com:RocketChat/Rocket.Chat: (294 commits)
  Chore: Convert UserCardWithData to ts (#26192)
  Chore: cleanup startup of test and put wizard in setup function (#26306)
  Chore: Convert AccountPreferencesPage to ts (#26096)
  [FIX] Missing bio field UI validation (#26345)
  Chore: Remove square prop from IconButton (#26343)
  Chore: Rewrite VerticalBarOldActions to TS (#26277)
  Chore: Replace direct multiple icon (#26342)
  Chore: Upgrade ESLint (#26132)
  Chore: convert autotranslate to ts (#25953)
  Chore: Change some places still using fields to projection (#26308)
  Bump version to 5.1.0-develop
  Bump version to 5.0.0
  Bump version to 5.0.0-rc.12
  Regression: Livechat not rendering UiKit messages with action buttons (#26327)
  Chore: bump fuselage packages (#26325)
  Chore: Update useSidebarPalette selectors (#26322)
  Regression: Fix get myself user data (#26328)
  Bump version to 5.0.0-rc.11
  Bump version to 4.8.2
  Regression: fix `directory` endpoint not listing teams (#26310)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants