Skip to content

fix: Non-deterministic comparator in team's channel desertion table#40857

Merged
tassoevan merged 1 commit into
developfrom
fix/non-deterministic-comparator
Jun 9, 2026
Merged

fix: Non-deterministic comparator in team's channel desertion table#40857
tassoevan merged 1 commit into
developfrom
fix/non-deterministic-comparator

Conversation

@tassoevan

@tassoevan tassoevan commented Jun 9, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

It fixes non-deterministic comparator in team's channel desertion table.

Issue(s)

Steps to test or reproduce

Further comments

Suggested by @coderabbitai in #40819

Task: ARCH-2172

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a non-deterministic sorting issue in the team channel desertion table so results are now consistently ordered across sessions and views.
    • Empty or missing values are now handled predictably and are sorted after populated entries, improving reliability and readability of lists and user-facing reports.

@tassoevan tassoevan added this to the 8.6.0 milestone Jun 9, 2026
@tassoevan tassoevan requested a review from a team as a code owner June 9, 2026 16:36
@dionisio-bot

dionisio-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jun 9, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0311213

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch

Not sure what this means? Click here to learn what changesets are.

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

@tassoevan

Copy link
Copy Markdown
Member Author

/jira ARCH-2167

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4c63ddb4-94df-4f4d-92e4-d46c2f684e58

📥 Commits

Reviewing files that changed from the base of the PR and between 97f2051 and 0311213.

📒 Files selected for processing (1)
  • .changeset/easy-laws-talk.md
✅ Files skipped from review due to trivial changes (1)
  • .changeset/easy-laws-talk.md
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check

Walkthrough

Replaces mutating Array.sort with Array.toSorted in ChannelDesertionTable and rewrites the comparator to deterministically handle empty values and compare via localeCompare; adds a changeset declaring a patch for @rocket.chat/meteor.

Changes

Non-deterministic Comparator Fix

Layer / File(s) Summary
Comparator determinism fix
apps/meteor/client/views/teams/ChannelDesertionTable/ChannelDesertionTable.tsx, .changeset/easy-laws-talk.md
ChannelDesertionTable replaces sort() with toSorted() and rewrites the comparator to derive values from the sortBy field using ?? '', explicitly handle both-empty and single-empty cases (ordering empty after present), and use localeCompare multiplied by the sort direction. A changeset entry documents a patch release for the fix.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: fixing a non-deterministic comparator in the channel desertion table component, which aligns with the file modifications and changeset entry.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • ARCH-2172: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ggazzo
ggazzo previously approved these changes Jun 9, 2026
@tassoevan tassoevan force-pushed the fix/non-deterministic-comparator branch from 97f2051 to 0311213 Compare June 9, 2026 16:44

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.11%. Comparing base (1b88937) to head (0311213).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #40857      +/-   ##
===========================================
- Coverage    70.12%   70.11%   -0.01%     
===========================================
  Files         3341     3341              
  Lines       123558   123567       +9     
  Branches     22136    22078      -58     
===========================================
- Hits         86642    86641       -1     
- Misses       33567    33576       +9     
- Partials      3349     3350       +1     
Flag Coverage Δ
e2e 59.29% <0.00%> (-0.05%) ⬇️
e2e-api 46.26% <ø> (-0.01%) ⬇️
unit 70.95% <ø> (+0.01%) ⬆️

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.

@tassoevan tassoevan added the stat: QA assured Means it has been tested and approved by a company insider label Jun 9, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jun 9, 2026
@tassoevan tassoevan enabled auto-merge June 9, 2026 17:46
@tassoevan tassoevan added this pull request to the merge queue Jun 9, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 9, 2026
@tassoevan tassoevan added this pull request to the merge queue Jun 9, 2026
Merged via the queue into develop with commit 590a618 Jun 9, 2026
82 of 85 checks passed
@tassoevan tassoevan deleted the fix/non-deterministic-comparator branch June 9, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants