Skip to content

[FIX] Wrong pagination information on /api/v1/channels.members#10224

Merged
rodrigok merged 1 commit intodevelopfrom
fix/rest-pagination-channels-members
Apr 3, 2018
Merged

[FIX] Wrong pagination information on /api/v1/channels.members#10224
rodrigok merged 1 commit intodevelopfrom
fix/rest-pagination-channels-members

Conversation

@MarcosSpessatto
Copy link
Copy Markdown
Contributor

Closes #9987.

Changed the sort order of the member list, members list size, and added tests to channels.members endpoint.

Changed the sort orderof the member list, members list size, and added tests to channels.members endpoint
const shouldBeOrderedDesc = Match.test(sort, Object) && Match.test(sort.username, Number) && sort.username === -1;

const members = RocketChat.models.Rooms.processQueryOptionsOnResult(Array.from(findResult.usernames).sort(sortFn), {
let members = RocketChat.models.Rooms.processQueryOptionsOnResult(Array.from(findResult.usernames).sort(), {
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.

Shouldn't the query be sorted desc? Otherwise I guess the results will not be sorted in desc overall 🤔

I haven't tested, just reading the code...

@rodrigok rodrigok added this to the 0.63.0 milestone Apr 3, 2018
@rodrigok rodrigok changed the title [FIX] Fix the pagination of channels.members endpoint [FIX] Wrong pagination information on /api/v1/channels.members Apr 3, 2018
@rodrigok rodrigok merged commit a5cf60b into develop Apr 3, 2018
@rodrigok rodrigok deleted the fix/rest-pagination-channels-members branch April 3, 2018 14:24
@rodrigok rodrigok mentioned this pull request Apr 4, 2018
trongthanh added a commit to goalifyplus/Goalify.Chat that referenced this pull request Apr 6, 2018
* develop: (91 commits)
  [FIX] Audio Message UI fixes (RocketChat#10303)
  [NEW] Improve history generation (RocketChat#10319)
  Strip the colons when searching (RocketChat#10323)
  Bump snap version to include security fix (RocketChat#10313)
  Update Meteor to 1.6.1.1 (RocketChat#10314)
  [FIX] Unable to mention after newline in message (RocketChat#10078)
  [FIX] Wrong pagination information on /api/v1/channels.members (RocketChat#10224)
  [FIX] Inline code following a url leads to autolinking of code with url (RocketChat#10163)
  Fixed issue on incoming webhooks that caused the content raw to not be available (RocketChat#10258)
  [FIX] Missing Translation Key on Reactions (RocketChat#10270)
  Fix: inputs for rocketchat apps (RocketChat#10274)
  Fix: chat.react api not accepting previous emojis (RocketChat#10290)
  Fix: Scroll on content page (RocketChat#10300)
  [FIX] File had redirect delay when using external storage services and no option to proxy only avatars
  Add quotes in the endpoint deprecation warning
  Add deprecation warning to user.roles endpoint
  Improve pt-BR translations
  Fix caddy download link to pull from github
  Renaming channels.notifications Get/Post endpoints to subscriptions.getOne and rooms.saveNotifications
  Revert the removed endpoint, user.roles
  ...

# Conflicts:
#	package-lock.json
trongthanh added a commit to goalifyplus/Goalify.Chat that referenced this pull request Apr 6, 2018
* goalify: (200 commits)
  Add S3 upload script
  Remove root-priviledged command
  switch gitlab ci config to use shell executor
  Try another build
  fix change language not reload
  temporary disable readonly
  [FIX] Audio Message UI fixes (RocketChat#10303)
  [NEW] Improve history generation (RocketChat#10319)
  Strip the colons when searching (RocketChat#10323)
  Bump snap version to include security fix (RocketChat#10313)
  Update Meteor to 1.6.1.1 (RocketChat#10314)
  [FIX] Unable to mention after newline in message (RocketChat#10078)
  [FIX] Wrong pagination information on /api/v1/channels.members (RocketChat#10224)
  [FIX] Inline code following a url leads to autolinking of code with url (RocketChat#10163)
  Fixed issue on incoming webhooks that caused the content raw to not be available (RocketChat#10258)
  [FIX] Missing Translation Key on Reactions (RocketChat#10270)
  Fix: inputs for rocketchat apps (RocketChat#10274)
  Fix: chat.react api not accepting previous emojis (RocketChat#10290)
  Fix: Scroll on content page (RocketChat#10300)
  change weather city to location
  ...

# Conflicts:
#	.docker/Dockerfile
#	.sandstorm/sandstorm-pkgdef.capnp
#	.travis/snap.sh
#	HISTORY.md
#	package.json
#	packages/rocketchat-lib/rocketchat.info
#	packages/rocketchat-lib/server/functions/deleteUser.js
#	packages/rocketchat-theme/client/imports/components/main-content.css
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