Skip to content

regression: thread not loading latest messages when jumping to recent (sending a message) - #41935

Merged
juliajforesti merged 2 commits into
release-8.8.0from
regression/thread-jump-to-recent
Aug 25, 2026
Merged

regression: thread not loading latest messages when jumping to recent (sending a message)#41935
juliajforesti merged 2 commits into
release-8.8.0from
regression/thread-jump-to-recent

Conversation

@MartinSchoeler

@MartinSchoeler MartinSchoeler commented Aug 25, 2026

Copy link
Copy Markdown
Member

CORE-2519

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved thread navigation when newer replies are available.
    • New messages posted by you now reliably appear at the bottom of the thread.
    • Jumping to the latest thread replies now refreshes the message view correctly.
    • Improved handling when navigating between older and newer portions of a thread.

@dionisio-bot

dionisio-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

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

@coderabbitai

coderabbitai Bot commented Aug 25, 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 Plus

Run ID: 0ca0c63d-bb8f-4742-9dec-4822cf8e4526

📥 Commits

Reviewing files that changed from the base of the PR and between 143a7e2 and 03860ce.

📒 Files selected for processing (3)
  • apps/meteor/client/views/room/contextualBar/Threads/components/ThreadMessageList.tsx
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: Hacktron Security Check
🧰 Additional context used
📓 Path-based instructions (3)
The main Rocket.Chat Meteor application resides in `apps/meteor/`; place its application code there rather than in other monorepo areas.

📄 CodeRabbit inference engine (CLAUDE.md)

Files:

  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.ts
  • apps/meteor/client/views/room/contextualBar/Threads/components/ThreadMessageList.tsx
Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests

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

Files:

  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.ts
  • apps/meteor/client/views/room/contextualBar/Threads/components/ThreadMessageList.tsx
Use descriptive test names that clearly communicate expected behavior in Playwright tests

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

Files:

  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts
🧠 Learnings (2)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts
  • apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.ts
🔇 Additional comments (3)
apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.ts (1)

141-144: LGTM!

Also applies to: 208-208

apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts (1)

1-132: LGTM!

apps/meteor/client/views/room/contextualBar/Threads/components/ThreadMessageList.tsx (1)

76-76: LGTM!

Also applies to: 263-263, 291-291, 359-373


Walkthrough

The thread query now supports resetting to recent messages. The message list uses this behavior for optimistic current-user messages when newer pages exist. Tests cover pagination, historical jumps, recent refetches, and detached windows.

Changes

Thread message pagination

Layer / File(s) Summary
Recent-message query reset
apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.ts, apps/meteor/client/views/room/contextualBar/Threads/hooks/useThreadMessagesQuery.spec.ts
useThreadMessagesQuery exposes jumpToRecent. Tests cover initial pagination, historical jumps, newer-page detection, recent-page refetching, and detached-window replacement.
Optimistic message list integration
apps/meteor/client/views/room/contextualBar/Threads/components/ThreadMessageList.tsx
Optimistic current-user messages trigger direct bottom scrolling when no newer page exists. When newer pages exist, the list calls jumpToRecent before scrolling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 03860

This is a localized fix to thread message loading behavior, and no actionable merge-blocking risk remains beyond normal checks and review.

Suggested labels: type: bug

Suggested reviewers: ggazzo, abhinavkrin

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: loading the latest thread messages when sending a message triggers a jump to recent messages.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Warning

Errors were encountered while retrieving linked issues.

Errors (1)
  • CORE-2519: 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.

@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 03860ce

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

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.23077% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-8.8.0@143a7e2). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##             release-8.8.0   #41935   +/-   ##
================================================
  Coverage                 ?   69.37%           
================================================
  Files                    ?     4254           
  Lines                    ?   168875           
  Branches                 ?    30053           
================================================
  Hits                     ?   117151           
  Misses                   ?    46551           
  Partials                 ?     5173           
Flag Coverage Δ
e2e 58.83% <42.85%> (?)
e2e-api 45.86% <ø> (?)
unit 71.29% <69.23%> (?)

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.

@MartinSchoeler
MartinSchoeler marked this pull request as ready for review August 25, 2026 16:07
@MartinSchoeler
MartinSchoeler requested a review from a team as a code owner August 25, 2026 16:07
@MartinSchoeler MartinSchoeler changed the title fix: thread not loading latest messages when jumping to recent (sending a message) regression: thread not loading latest messages when jumping to recent (sending a message) Aug 25, 2026
@MartinSchoeler MartinSchoeler added this to the 8.8.0 milestone Aug 25, 2026

@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.

No issues found across 3 files

Re-trigger cubic

@juliajforesti juliajforesti added the stat: QA assured Means it has been tested and approved by a company insider label Aug 25, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Aug 25, 2026
@juliajforesti
juliajforesti merged commit d036fc2 into release-8.8.0 Aug 25, 2026
99 of 101 checks passed
@juliajforesti
juliajforesti deleted the regression/thread-jump-to-recent branch August 25, 2026 18:15
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