Skip to content

fix: missing edited indicator for thread parent message#40063

Queued
abhinavkrin wants to merge 4 commits intodevelopfrom
fix/missing-edited-indicator-thread-panel
Queued

fix: missing edited indicator for thread parent message#40063
abhinavkrin wants to merge 4 commits intodevelopfrom
fix/missing-edited-indicator-thread-panel

Conversation

@abhinavkrin
Copy link
Copy Markdown
Member

@abhinavkrin abhinavkrin commented Apr 7, 2026

Proposed changes (including videos or screenshots)

What is changed:
Restored the edited indicator (pencil icon) for the main thread message when viewed inside the thread panel.

Why it is needed:
Previously, the indicator correctly showed in the main channel view but was missing in the thread panel context, leading to inconsistent UI behavior.

High-level technical explanation:
The root cause was a TypeScript typing mismatch. The mapMessageFromApi function was originally typed to always return the base IMessage type, regardless of the input. This stripped away type recognition for extra fields present in variants like IEditedMessage (e.g., editedAt, dlm), causing downstream UI components to miss the necessary flags to render the edited indicator.

To resolve this, mapMessageFromApi was made generic (<T extends MappableMessage = IMessage>). The function now returns the exact same type as the input, preserving all fields (like editedAt) and type safety without requiring unsafe type casts.

Issue(s)

Steps to test or reproduce

Further comments

CORE-1964

Summary by CodeRabbit

  • Bug Fixes

    • Restored the "edited" indicator for parent messages in the thread panel so it matches the main channel view.
  • Refactor

    • Message mapping logic improved to consistently handle additional timestamp fields.
  • Tests

    • Added tests covering conversion of message timestamp fields to Date objects and handling of optional date fields.

…iants

Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
@abhinavkrin abhinavkrin requested a review from a team as a code owner April 7, 2026 15:20
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 7, 2026

🦋 Changeset detected

Latest commit: 76bf2a1

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/models 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/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch
@rocket.chat/server-fetch Patch
@rocket.chat/ui-video-conf 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

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Apr 7, 2026

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

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: c9544c12-95fd-4303-8d1d-8671ab810af1

📥 Commits

Reviewing files that changed from the base of the PR and between 6b94697 and 7f31d9b.

📒 Files selected for processing (1)
  • apps/meteor/client/lib/utils/mapMessageFromApi.spec.ts
✅ Files skipped from review due to trivial changes (1)
  • apps/meteor/client/lib/utils/mapMessageFromApi.spec.ts
📜 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). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: cubic · AI code reviewer
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Walkthrough

Generalizes the message API mapper to include optional fields (editedAt, dlm) and convert them to Dates, adds tests validating date conversions and absence behavior, and adds a changeset marking a patch that fixes the missing edited indicator for the main thread message in the thread panel.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/dry-squids-wonder.md
Adds a patch changeset for @rocket.chat/meteor describing the thread-panel edited indicator fix.
Mapper Utility Enhancement
apps/meteor/client/lib/utils/mapMessageFromApi.ts
Generalizes mapMessageFromApi to a generic T extends MappableMessage, adds conditional Date conversion for editedAt and dlm, updates attachment mapping to spread fields, and returns typed T.
Mapper Test Suite
apps/meteor/client/lib/utils/mapMessageFromApi.spec.ts
Adds tests: one asserting multiple ISO timestamp fields (including nested attachment ts and editedAt) map to Date, another asserting optional date fields stay undefined when absent.

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 clearly and accurately describes the main change: fixing the missing edited indicator for thread parent messages.
Linked Issues check ✅ Passed The code changes directly address CORE-1964 by generalizing mapMessageFromApi to preserve message variant fields like editedAt, enabling the edited indicator display.
Out of Scope Changes check ✅ Passed All changes are scoped to the issue objective: a changeset entry, a test file for mapMessageFromApi, and updates to the mapper function to support the fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

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 3 files

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.83%. Comparing base (918e0b0) to head (76bf2a1).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #40063   +/-   ##
========================================
  Coverage    69.83%   69.83%           
========================================
  Files         3296     3296           
  Lines       119165   119172    +7     
  Branches     21467    21542   +75     
========================================
+ Hits         83219    83226    +7     
- Misses       32654    32656    +2     
+ Partials      3292     3290    -2     
Flag Coverage Δ
e2e 59.78% <50.00%> (-0.03%) ⬇️
e2e-api 46.23% <ø> (-0.11%) ⬇️
unit 70.57% <100.00%> (+0.03%) ⬆️

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.

Comment thread apps/meteor/client/lib/utils/mapMessageFromApi.spec.ts Outdated
Signed-off-by: Abhinav Kumar <abhinav@avitechlab.com>
@abhinavkrin abhinavkrin requested a review from dougfabris April 9, 2026 17:01
@dougfabris dougfabris added this to the 8.5.0 milestone Apr 20, 2026
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Apr 22, 2026
@dougfabris dougfabris modified the milestones: 8.5.0, 8.4.0 Apr 22, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Apr 22, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue Apr 22, 2026
Any commits made after this event will not be merged.
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2026
@dionisio-bot dionisio-bot Bot enabled auto-merge April 22, 2026 15:10
@dougfabris dougfabris removed the stat: QA assured Means it has been tested and approved by a company insider label Apr 22, 2026
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Apr 22, 2026
@dougfabris dougfabris added the stat: QA assured Means it has been tested and approved by a company insider label Apr 22, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Apr 22, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue Apr 22, 2026
Any commits made after this event will not be merged.
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