Skip to content

fix: filter versionUpdate banners where version <= current installed#38932

Merged
ggazzo merged 13 commits intodevelopfrom
fix/versionupdate-banner
Feb 26, 2026
Merged

fix: filter versionUpdate banners where version <= current installed#38932
ggazzo merged 13 commits intodevelopfrom
fix/versionupdate-banner

Conversation

@ricardogarim
Copy link
Copy Markdown
Member

@ricardogarim ricardogarim commented Feb 23, 2026

This PR fixes a bug where servers display outdated version update banners after upgrading. For example, a server on version 7.5 was showing a banner prompting to update to version 6.2.0.

Old versionUpdate banners persist in admin user documents (user.banners) after server upgrades. When the server was on 6.1.x, a banner for 6.2.0 was created. After upgrading to 7.5, the old banner remained in the database and continued to be displayed if not read.

Proposed changes (including videos or screenshots)

1. Filter outdated banners in getUserInfo.ts

  • Added filterOutdatedVersionUpdateBanners() function that filters out version banners where version ≤ current installed version
  • Applied when returning user data via /me endpoint (primary way client gets banners)

2. Cleanup outdated banners in buildVersionUpdateMessage.ts

  • Added cleanupOutdatedVersionUpdateBanners() function that removes outdated banners from admin users in the database
  • Runs before creating new version banners during version check
  • Addresses the watch.users stream case where banners are sent directly from DB

3. Sort versions descending before processing

  • Ensures the highest available version is processed first
  • Combined with the existing break statement, only the highest version banner is created

Issue(s)

Steps to test or reproduce

  1. Have a server on version X with a version update banner for version Y (where Y > X)
  2. Upgrade server to version Z (where Z > Y)
  3. Before fix: banner for version Y still shows (incorrect)
  4. After fix: banner for version Y is removed/filtered (correct)

To test the filter:

  1. Manually add an old version banner to an admin user's banners field
  2. Call /api/v1/me endpoint
  3. Verify the old banner is not returned

To test the cleanup:

  1. Trigger a version check (server startup or wait for cron)
  2. Verify old banners are removed from admin users in the database

Further comments

  • The filter in getUserInfo provides immediate protection for the /me endpoint
  • The cleanup in buildVersionUpdateMessage ensures the database stays clean and handles the watch.users stream case
  • Minor version banners (e.g., 8.0.0, 8.1.0, 8.2.0) are preserved as they may have different release notes
  • Only banners for versions ≤ current installed are removed/filtered

Summary by CodeRabbit

  • Bug Fixes

    • Version update banner now filters out outdated or invalid version notices and removes stale banners from admin accounts so only newer, relevant updates are shown.
  • Tests

    • New and expanded server-side tests covering banner filtering, version ordering, cleanup of outdated banners, and message generation.
  • Chores

    • Added a changeset for a patch release and expanded server test discovery to include the new specs.

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Feb 23, 2026

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

  • This PR is targeting the wrong base branch. It should target 8.3.0, but it targets 8.2.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 23, 2026

🦋 Changeset detected

Latest commit: 7895954

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

This PR includes changesets to release 41 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/abac Patch
@rocket.chat/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch 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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 23, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds semver-based filtering and bulk cleanup of outdated or invalid "versionUpdate-*" banners, applies filtering in getUserInfo, updates buildVersionUpdateMessage to accept structured version objects and sort them descending, adds bulk banner update model methods, tests, and a changeset for a patch bump.

Changes

Cohort / File(s) Summary
Changeset & Jest config
/.changeset/olive-hairs-report.md, apps/meteor/jest.config.ts
Adds a changeset declaring a patch bump for @rocket.chat/meteor; expands server spec discovery in Jest testMatch.
getUserInfo banner filtering & tests
apps/meteor/app/api/server/helpers/getUserInfo.ts, apps/meteor/app/api/server/helpers/getUserInfo.spec.ts
Adds filterOutdatedVersionUpdateBanners using Info.version and semver; applies it to returned user banners; adds tests for outdated, newer, invalid-semver, and non-version banners.
Version update processing, cleanup & tests
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts, apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
Adds cleanupOutdatedVersionUpdateBanners to remove stale/invalid versionUpdate-* banners from admin users, sorts incoming versions by semver descending, updates buildVersionUpdateMessage signature to accept version objects, and adds tests verifying cleanup, sorting, and notification behavior.
Models & typings bulk update
packages/models/src/models/Users.ts, packages/model-typings/src/models/IUsersModel.ts
Adds setBannersInBulk on UsersRaw and corresponding interface method; implements bulkWrite-based banner updates and imports required MongoDB types.

Sequence Diagram(s)

sequenceDiagram
  actor VersionService as "Version Checker"
  participant Info as "Info (current version)"
  participant Users as "Users Model"
  participant Notifier as "sendMessagesToAdmins / Notifier"

  rect rgba(200,200,255,0.5)
    VersionService->>Info: read current installed version
    VersionService->>Users: fetch admin users with banners
    Users-->>VersionService: admin users + banners
    VersionService->>Users: remove outdated/invalid versionUpdate-* banners (bulk)
  end

  rect rgba(200,255,200,0.5)
    VersionService->>VersionService: sort available versions (semver desc)
    VersionService->>Notifier: send messages for highest new version
    Notifier-->>Users: deliver banner updates to admins
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately and clearly summarizes the main change: filtering versionUpdate banners where the banner version is less than or equal to the current installed version.
Linked Issues check ✅ Passed The PR fully addresses the CORE-1084 requirement by implementing both client-side filtering in getUserInfo (prevents outdated banners in API responses) and server-side cleanup in buildVersionUpdateMessage (removes stale banners from database), ensuring no outdated version banners appear post-upgrade.
Out of Scope Changes check ✅ Passed All changes directly support the core objective: filtering logic, test coverage, bulk banner update infrastructure, and jest config expansion for new tests are all scoped to the versionUpdate banner fix.

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


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.

@ricardogarim ricardogarim force-pushed the fix/versionupdate-banner branch from b359052 to 6c20de6 Compare February 23, 2026 16:12
@ricardogarim
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts (1)

87-104: Consider adding a test for the admin.banners = undefined guard path

The implementation has an explicit early-exit (if (!admin.banners) { continue; }) for admins returned from the query with no banners field, but there is no test covering this branch. Adding a case where the admin object has no banners property would provide complete coverage of the guard.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts`
around lines 87 - 104, Add a new spec in the
describe('cleanupOutdatedVersionUpdateBanners') block that returns an admin
object without a banners property from mockFindUsersInRolesWithQuery and calls
buildVersionUpdateMessage([]); assert that mockRemoveBannerById was not called,
verifying the early-exit guard (the code path in buildVersionUpdateMessage that
checks if (!admin.banners) { continue; }). Use the same test pattern as the
existing cases
(mockFindUsersInRolesWithQuery.mockReturnValue(createAsyncIterableFromArray([admin]))
and await buildVersionUpdateMessage([])) and
expect(mockRemoveBannerById).not.toHaveBeenCalled().
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts (2)

19-19: for await over a synchronous Object.keys array is unnecessary

Object.keys returns a plain string[] — a synchronous iterable. for await...of works here because it wraps each value in Promise.resolve, but it misleads readers into thinking the keys are an async source. The await needed for removeBannerById belongs on the call inside the loop body, not on the iteration itself.

♻️ Proposed fix
-		for await (const bannerId of Object.keys(admin.banners)) {
+		for (const bannerId of Object.keys(admin.banners)) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts`
at line 19, In buildVersionUpdateMessage, the loop uses "for await (const
bannerId of Object.keys(admin.banners))" which is unnecessary because
Object.keys returns a synchronous string[]; change the loop to a regular "for
(const bannerId of Object.keys(admin.banners))" and ensure the async call
removeBannerById(bannerId) inside the loop is awaited (await
removeBannerById(...)) so the removal still happens sequentially and any errors
propagate correctly; reference admin.banners, the loop over bannerId, and
removeBannerById when making this change.

49-49: semver.rcompare throws TypeError for any non-semver string in versions, aborting the entire function

new SemVer(...) inside rcompare throws TypeError: Invalid Version for malformed strings, and that exception propagates out of Array.sort, preventing any banner creation or cleanup for that run. The versions array is API-sourced so this is low-risk in practice, but pre-filtering with semver.valid before sorting is cheap insurance.

🛡️ Proposed defensive filter before sort
-	const sortedVersions = [...versions].sort((a, b) => semver.rcompare(a.version, b.version));
+	const sortedVersions = [...versions]
+		.filter((v) => semver.valid(v.version))
+		.sort((a, b) => semver.rcompare(a.version, b.version));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts`
at line 49, The sort can throw when semver.rcompare encounters invalid version
strings; before calling semver.rcompare in the creation of sortedVersions,
pre-filter the versions array by checking semver.valid (e.g. keep entries where
semver.valid(v.version) is truthy) so only valid semver strings are passed into
the sort, and optionally log or drop invalid entries; update the code that
builds sortedVersions (the variable named sortedVersions and the source array
versions) to perform this defensive filter prior to sorting with
semver.rcompare.
apps/meteor/app/api/server/helpers/getUserInfo.spec.ts (1)

212-238: Add an edge-case test for a banner whose version exactly equals the current installed version

The semver.lte boundary includes equality — a banner for version 7.5.0 when Info.version is 7.5.0 should be filtered out. This "equal" case isn't covered and is the most interesting boundary given the PR's stated semantics ("version ≤ current installed").

➕ Suggested additional test
+		it('should filter out versionUpdate banners for the exact current installed version', async () => {
+			user.banners = {
+				'versionUpdate-7_5_0': { id: 'versionUpdate-7_5_0', priority: 10, title: 'Update', text: 'New version', modifiers: [], link: '', read: false },
+			};
+			const userInfo = await getUserInfo(user);
+			expect(userInfo.banners).toEqual({});
+		});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/api/server/helpers/getUserInfo.spec.ts` around lines 212 -
238, Add a test case to cover the equality boundary for semver.lte: in the
describe block for "version update banner filtering" (where mockInfoVersion is
set to '7.5.0') create a new it() that sets user.banners to include a
'versionUpdate-7_5_0' banner, call getUserInfo(user), and assert that the
returned userInfo.banners does not contain that banner (expect toEqual({}) or to
notHaveProperty('versionUpdate-7_5_0')). This ensures the equality case (banner
version === Info.version) is filtered out as intended.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts`:
- Around line 11-30: cleanupOutdatedVersionUpdateBanners currently only removes
banners when semver.valid(version) is true, so malformed version banner IDs
accumulate; update cleanupOutdatedVersionUpdateBanners to also remove banners
where semver.valid(version) is false (i.e., when bannerId
startsWith('versionUpdate-') but parsed version is invalid) by calling
Users.removeBannerById(admin._id, bannerId) for those cases (and optionally log
the removal), keeping the same bannerId parsing logic used now and aligning
behavior with filterOutdatedVersionUpdateBanners in getUserInfo.ts.

---

Nitpick comments:
In `@apps/meteor/app/api/server/helpers/getUserInfo.spec.ts`:
- Around line 212-238: Add a test case to cover the equality boundary for
semver.lte: in the describe block for "version update banner filtering" (where
mockInfoVersion is set to '7.5.0') create a new it() that sets user.banners to
include a 'versionUpdate-7_5_0' banner, call getUserInfo(user), and assert that
the returned userInfo.banners does not contain that banner (expect toEqual({})
or to notHaveProperty('versionUpdate-7_5_0')). This ensures the equality case
(banner version === Info.version) is filtered out as intended.

In
`@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts`:
- Around line 87-104: Add a new spec in the
describe('cleanupOutdatedVersionUpdateBanners') block that returns an admin
object without a banners property from mockFindUsersInRolesWithQuery and calls
buildVersionUpdateMessage([]); assert that mockRemoveBannerById was not called,
verifying the early-exit guard (the code path in buildVersionUpdateMessage that
checks if (!admin.banners) { continue; }). Use the same test pattern as the
existing cases
(mockFindUsersInRolesWithQuery.mockReturnValue(createAsyncIterableFromArray([admin]))
and await buildVersionUpdateMessage([])) and
expect(mockRemoveBannerById).not.toHaveBeenCalled().

In `@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts`:
- Line 19: In buildVersionUpdateMessage, the loop uses "for await (const
bannerId of Object.keys(admin.banners))" which is unnecessary because
Object.keys returns a synchronous string[]; change the loop to a regular "for
(const bannerId of Object.keys(admin.banners))" and ensure the async call
removeBannerById(bannerId) inside the loop is awaited (await
removeBannerById(...)) so the removal still happens sequentially and any errors
propagate correctly; reference admin.banners, the loop over bannerId, and
removeBannerById when making this change.
- Line 49: The sort can throw when semver.rcompare encounters invalid version
strings; before calling semver.rcompare in the creation of sortedVersions,
pre-filter the versions array by checking semver.valid (e.g. keep entries where
semver.valid(v.version) is truthy) so only valid semver strings are passed into
the sort, and optionally log or drop invalid entries; update the code that
builds sortedVersions (the variable named sortedVersions and the source array
versions) to perform this defensive filter prior to sorting with
semver.rcompare.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40347d4 and 5c9ca04.

📒 Files selected for processing (6)
  • .changeset/olive-hairs-report.md
  • apps/meteor/app/api/server/helpers/getUserInfo.spec.ts
  • apps/meteor/app/api/server/helpers/getUserInfo.ts
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
  • apps/meteor/jest.config.ts
📜 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: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/app/api/server/helpers/getUserInfo.spec.ts
  • apps/meteor/jest.config.ts
  • apps/meteor/app/api/server/helpers/getUserInfo.ts
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/app/api/server/helpers/getUserInfo.spec.ts
🧠 Learnings (16)
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/app/api/server/helpers/getUserInfo.spec.ts
  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/jest.config.ts
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/app/api/server/helpers/getUserInfo.ts
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`

Applied to files:

  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.spec.ts : Use `.spec.ts` extension for test files (e.g., `login.spec.ts`)

Applied to files:

  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests

Applied to files:

  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to **/*.{ts,tsx,js} : Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests

Applied to files:

  • apps/meteor/jest.config.ts
📚 Learning: 2025-11-05T20:53:57.761Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37357
File: apps/meteor/ee/server/startup/federation.ts:39-74
Timestamp: 2025-11-05T20:53:57.761Z
Learning: In Rocket.Chat (apps/meteor/app/settings/server/CachedSettings.ts), the settings.watchMultiple() method immediately invokes its callback with current values if all requested settings exist in the store, then continues watching for subsequent changes. It does not wait for a setting to change before the first invocation.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
🧬 Code graph analysis (1)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts (1)
packages/models/src/index.ts (1)
  • Users (192-192)
🔇 Additional comments (3)
apps/meteor/jest.config.ts (1)

51-51: LGTM — new testMatch entry is consistent with existing server patterns and correctly scopes the new spec file.

.changeset/olive-hairs-report.md (1)

1-5: LGTM — correct package target (@rocket.chat/meteor) and changeset type (patch) for this bug fix.

apps/meteor/app/api/server/helpers/getUserInfo.ts (1)

30-49: filterOutdatedVersionUpdateBanners implementation looks correct.

The short-circuit !semver.valid(version) guard at line 42 ensures semver.lte is never called with an invalid string, so no throw risk here.

@ricardogarim ricardogarim force-pushed the fix/versionupdate-banner branch from d45a429 to aac1e55 Compare February 23, 2026 17:00
@ricardogarim ricardogarim force-pushed the fix/versionupdate-banner branch from d541436 to e6920f7 Compare February 23, 2026 18:36
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 23, 2026

Codecov Report

❌ Patch coverage is 93.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.68%. Comparing base (18a1018) to head (7895954).
⚠️ Report is 54 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #38932      +/-   ##
===========================================
+ Coverage    70.66%   70.68%   +0.02%     
===========================================
  Files         3189     3191       +2     
  Lines       112717   112863     +146     
  Branches     20459    20443      -16     
===========================================
+ Hits         79655    79781     +126     
- Misses       31018    31037      +19     
- Partials      2044     2045       +1     
Flag Coverage Δ
e2e 60.35% <ø> (-0.04%) ⬇️
e2e-api 48.81% <ø> (-0.07%) ⬇️
unit 71.31% <93.33%> (+0.11%) ⬆️

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 added this to the 8.3.0 milestone Feb 23, 2026
@ricardogarim ricardogarim marked this pull request as ready for review February 24, 2026 11:12
@ricardogarim ricardogarim requested a review from a team as a code owner February 24, 2026 11:12
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 6 files

@KevLehman
Copy link
Copy Markdown
Member

By incredible reasons, this would fix #18922

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts`:
- Around line 78-80: The afterAll teardown currently restores TEST_MODE by
assigning process.env.TEST_MODE = originalTestMode which will write the string
"undefined" if originalTestMode was undefined; change the restore logic in the
afterAll block to check originalTestMode: if it's undefined use delete
process.env.TEST_MODE, otherwise set process.env.TEST_MODE = originalTestMode,
ensuring the process.env.TEST_MODE key is removed rather than set to the string
"undefined".

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6920f7 and ba12cd4.

📒 Files selected for processing (1)
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📜 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: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
🧠 Learnings (12)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:18.785Z
Learning: In Rocket.Chat PR reviews, maintain strict scope boundaries—when a PR is focused on a specific endpoint (e.g., rooms.favorite), avoid reviewing or suggesting changes to other endpoints that were incidentally refactored (e.g., rooms.invite) unless explicitly requested by maintainers.
📚 Learning: 2025-12-10T21:00:54.909Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37091
File: ee/packages/abac/jest.config.ts:4-7
Timestamp: 2025-12-10T21:00:54.909Z
Learning: Rocket.Chat monorepo: Jest testMatch pattern '<rootDir>/src/**/*.spec.(ts|js|mjs)' is valid in this repo and used across multiple packages (e.g., packages/tools, ee/packages/omnichannel-services). Do not flag it as invalid in future reviews.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
🧬 Code graph analysis (1)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts (2)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts (1)
  • buildVersionUpdateMessage (32-98)
apps/meteor/server/lib/sendMessagesToAdmins.ts (1)
  • sendMessagesToAdmins (29-84)
🔇 Additional comments (2)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts (2)

88-115: Cleanup test coverage is solid for outdated/newer/invalid banner IDs.

These cases directly validate the downgrade-filtering behavior targeted by CORE-1084.


117-137: Version-ordering assertion correctly verifies highest-version banner selection.

The toHaveBeenCalledTimes(1) + expected versionUpdate-8_0_0 pairing is a good guard for the single-banner flow.

@ricardogarim ricardogarim requested a review from a team as a code owner February 25, 2026 15:50
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts (1)

62-62: ⚠️ Potential issue | 🟠 Major

Pre-filter invalid semver strings before semver.rcompare to prevent TypeError.

semver.rcompare throws a TypeError when either argument is not a valid semver string. Since versions originates from an external cloud API response, malformed entries are plausible and would crash the entire version-check job before any banner logic executes.

🔧 Proposed fix
-	const sortedVersions = [...versions].sort((a, b) => semver.rcompare(a.version, b.version));
+	const sortedVersions = versions
+		.filter(({ version }) => Boolean(semver.valid(version)))
+		.sort((a, b) => semver.rcompare(a.version, b.version));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts`
at line 62, Pre-filter the incoming versions array for valid semver strings
before calling semver.rcompare to avoid TypeError: use semver.valid to filter
entries (e.g., keep only items where semver.valid(item.version) is truthy) and
then sort that filtered list; update the code around sortedVersions and versions
in buildVersionUpdateMessage to perform the filter first and optionally emit a
warning/log for any discarded malformed entries so invalid cloud API responses
don't crash the job.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts`:
- Line 62: Pre-filter the incoming versions array for valid semver strings
before calling semver.rcompare to avoid TypeError: use semver.valid to filter
entries (e.g., keep only items where semver.valid(item.version) is truthy) and
then sort that filtered list; update the code around sortedVersions and versions
in buildVersionUpdateMessage to perform the filter first and optionally emit a
warning/log for any discarded malformed entries so invalid cloud API responses
don't crash the job.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31cef5e and eb3f5b9.

📒 Files selected for processing (4)
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
  • packages/model-typings/src/models/IUsersModel.ts
  • packages/models/src/models/Users.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/model-typings/src/models/IUsersModel.ts
  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.spec.ts
  • packages/models/src/models/Users.ts
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
🧠 Learnings (9)
📓 Common learnings
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2026-02-24T19:09:09.561Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 38974
File: apps/meteor/app/api/server/v1/im.ts:220-221
Timestamp: 2026-02-24T19:09:09.561Z
Learning: In RocketChat/Rocket.Chat OpenAPI migration PRs for apps/meteor/app/api/server/v1 endpoints, maintainers prefer to avoid any logic changes; style-only cleanups (like removing inline comments) may be deferred to follow-ups to keep scope tight.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2026-02-23T17:53:18.785Z
Learnt from: ggazzo
Repo: RocketChat/Rocket.Chat PR: 35995
File: apps/meteor/app/api/server/v1/rooms.ts:1107-1112
Timestamp: 2026-02-23T17:53:18.785Z
Learning: In Rocket.Chat PR reviews, maintain strict scope boundaries—when a PR is focused on a specific endpoint (e.g., rooms.favorite), avoid reviewing or suggesting changes to other endpoints that were incidentally refactored (e.g., rooms.invite) unless explicitly requested by maintainers.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2026-02-24T19:05:56.710Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: In Rocket.Chat PRs, keep feature PRs free of unrelated lockfile-only dependency bumps; prefer reverting lockfile drift or isolating such bumps into a separate "chore" commit/PR, and always use yarn install --immutable with the Yarn version pinned in package.json via Corepack.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2025-11-10T19:06:20.146Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37408
File: apps/meteor/client/views/admin/ABAC/useRoomAttributeOptions.tsx:53-69
Timestamp: 2025-11-10T19:06:20.146Z
Learning: In the Rocket.Chat repository, do not provide suggestions or recommendations about code sections marked with TODO comments. The maintainers have already identified these as future work and external reviewers lack the full context about implementation plans and timing.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2026-02-24T19:05:56.710Z
Learnt from: ahmed-n-abdeltwab
Repo: RocketChat/Rocket.Chat PR: 0
File: :0-0
Timestamp: 2026-02-24T19:05:56.710Z
Learning: Rocket.Chat repo context: When a workspace manifest on develop already pins a dependency version (e.g., packages/web-ui-registration → "rocket.chat/ui-contexts": "27.0.1"), a lockfile change in a feature PR that upgrades only that dependency’s resolution is considered a manifest-driven sync and can be kept, preferably as a small "chore: sync yarn.lock with manifests" commit.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
📚 Learning: 2025-11-05T20:53:57.761Z
Learnt from: sampaiodiego
Repo: RocketChat/Rocket.Chat PR: 37357
File: apps/meteor/ee/server/startup/federation.ts:39-74
Timestamp: 2025-11-05T20:53:57.761Z
Learning: In Rocket.Chat (apps/meteor/app/settings/server/CachedSettings.ts), the settings.watchMultiple() method immediately invokes its callback with current values if all requested settings exist in the store, then continues watching for subsequent changes. It does not wait for a setting to change before the first invocation.

Applied to files:

  • apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts
🧬 Code graph analysis (1)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts (2)
packages/models/src/index.ts (1)
  • Users (192-192)
packages/core-typings/src/IUser.ts (1)
  • IUser (169-239)
🔇 Additional comments (3)
apps/meteor/app/version-check/server/functions/buildVersionUpdateMessage.ts (3)

1-2: LGTM!

Imports are clean and both IUser (used for typing in updates array) and Users (used for DB queries and bulk updates) are consumed in the new code.


12-43: LGTM!

The cleanup logic correctly removes both invalid-semver and outdated (<= Info.version) banners, consistent with the API-side filtering in getUserInfo.ts. The short-circuit on !semver.valid(version) prevents semver.lte from being called with an invalid left operand. Batching updates via setBannersInBulk and skipping users with no banner changes is efficient.


66-110: LGTM!

The descending-sort + break pattern correctly ensures only the single highest applicable version produces a banner and notification. The skip guards for prereleases and versions ≤ lastCheckedVersion / Info.version are sound.

abhinavkrin
abhinavkrin previously approved these changes Feb 25, 2026
@ricardogarim ricardogarim force-pushed the fix/versionupdate-banner branch from 1aef834 to 7dc92f0 Compare February 25, 2026 17:16
KevLehman
KevLehman previously approved these changes Feb 25, 2026
@ricardogarim ricardogarim force-pushed the fix/versionupdate-banner branch from f8ec332 to 7895954 Compare February 25, 2026 19:19
@ricardogarim ricardogarim added the stat: QA assured Means it has been tested and approved by a company insider label Feb 25, 2026
@dionisio-bot dionisio-bot bot enabled auto-merge February 25, 2026 19:29
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Feb 25, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 25, 2026
@ricardogarim ricardogarim added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Feb 25, 2026
@dionisio-bot dionisio-bot bot added this pull request to the merge queue Feb 25, 2026
@ggazzo ggazzo removed this pull request from the merge queue due to a manual request Feb 26, 2026
@ggazzo ggazzo merged commit 37a7602 into develop Feb 26, 2026
47 checks passed
@ggazzo ggazzo deleted the fix/versionupdate-banner branch February 26, 2026 00:38
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 type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants