fix: thread content disappears after jumping to recent messages

Merged
AB
6mo ago
+425-94

Proposed changes (including videos or screenshots)

Fixes an issue where thread content disappears when navigating to recent messages from the main channel.

The issue was caused by shared state between the main message view and the thread message view, leading to unintended resets. RoomHistoryManager.clear() method in RoomHistoryManager.ts:288-296. When "Jump to recent messages" is clicked, the method removes all messages for that room ID from the Messages store, including thread messages. This was causing the thread panel content to be cleared unexpectedly.

This PR:

  • Introduces separate message stores for main and thread views
  • Uses TanStack Query to manage thread messages independently

This ensures thread content remains stable regardless of navigation in the main channel.

Issue(s)

Steps to test or reproduce

Further comments

CORE-1186

Summary by CodeRabbit

  • New Features
    • Dedicated thread query and subscription flow with centralized thread cache keys and utilities for consistent thread message handling.
  • Bug Fixes
    • Persist and upsert thread messages into the client cache to prevent thread content from disappearing after navigation actions.
  • Tests
    • Added an end-to-end spec for thread persistence and a test helper to seed filler messages.