regression: Ephemeral messages not showing on threads

Merged
JE
5mo ago
+55-19

Proposed changes (including videos or screenshots)

Fixes non-member mention warnings not appearing inside thread replies.

Fixes ephemeral messages (e.g. non-member mention warnings) not appearing inside thread replies.
The root cause was that the notify-user stream — which delivers user-scoped ephemeral messages — was not feeding into the thread message cache. The fix adds a check in incomingMessages.ts: when an incoming ephemeral message has a tmid, it is forwarded to upsertThreadMessageInCache so it gets inserted into the correct thread, in addition to being stored in the regular message store.

This PR also adds/updates e2e coverage for message mention warnings:

  • Adds a thread scenario that mentions a non-member and verifies the warning actions are visible inside the thread.
  • Reuses page-object helpers for warning action buttons in regular messages and thread messages.
  • Keeps the existing permission-specific warning action assertions for room messages.

Issue(s)

CORE-2278
Root cause: https://github.com/RocketChat/Rocket.Chat/pull/39859

Steps to test or reproduce

  1. Create or open a channel where the target user is not a member.
  2. Send a message and open its thread.
  3. Send a thread reply mentioning the non-member user.
  4. Verify the non-member mention warning appears inside the thread with the expected actions:
    • Do nothing
    • Add them
    • Let them know

Automated coverage: apps/meteor/tests/e2e/message-mentions.spec.ts includes the should show non-member mention warning inside threads scenario.

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Improved thread message caching for ephemeral incoming messages.
  • Tests

    • Added test coverage for message mention warnings triggered within thread conversations.
    • Refactored mention warning tests with improved helper utilities.