fix(search): an edited message shows once, with its latest text (#288) #388

Merged
jared merged 1 commits from fix/search-edit-dupes into lotus 2026-10-18 00:59:47 -04:00
Owner

Fixes #288.

Server search returns the m.replace events as well, so a message edited twice showed up as three results, one per version.

Change: new foldEdits step before grouping. Each edit is folded into its message, giving one row that:

  • sits at the position of the best-ranked version;
  • shows the latest m.new_content;
  • points at the original event, so Open jumps to the real message.

If only an edit matched, it stands in for its message, under the original's id.

Verified (local Synapse; one message, edited twice; search for its tag):

  • Before: Tuesday 11am room B, Tuesday 10am room A, Monday 10am room A.
  • After: Tuesday 11am room B only.

Unit tests for folding. tsc clean · unit tests pass · ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #288. Server search returns the `m.replace` events as well, so a message edited twice showed up as **three** results, one per version. **Change:** new `foldEdits` step before grouping. Each edit is folded into its message, giving one row that: - sits at the position of the best-ranked version; - shows the **latest** `m.new_content`; - points at the **original** event, so Open jumps to the real message. If only an edit matched, it stands in for its message, under the original's id. **Verified** (local Synapse; one message, edited twice; search for its tag): - **Before:** `Tuesday 11am room B`, `Tuesday 10am room A`, `Monday 10am room A`. - **After:** `Tuesday 11am room B` only. Unit tests for folding. `tsc` clean · unit tests pass · ESLint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-17 20:14:13 -04:00
fix(search): an edited message shows once, with its latest text (#288)
CI / Build & Quality Checks (pull_request) Successful in 2m57s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 14s
CI / Playwright smoke (e2e) (pull_request) Successful in 14m21s
0d08ba0a55
Server search also returns the m.replace events, so one message edited
twice came back as three rows. Fold edits into their message: one row
at the best-ranked position, showing the latest m.new_content and
pointing at the original event so Open jumps to the real message.

Fixes #288

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit d412f9c56c into lotus 2026-10-18 00:59:47 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#388