fix: own account showing twice in navbar room search when searching by username
Merged
NA
4mo ago+65+65+01234567890123456789-2-2-0123456789
Proposed changes (including videos or screenshots)
Filter out own DMs from local rooms. Previously we were only removing duplicate of DMs with only two members (room.uids.length === 2 condition in sameDirectDM).
Issue(s)
Steps to test or reproduce
- Log in as any user.
- Create a DM with yourself.
- Open the navbar search.
- Search for your own username (not display name).
- Your account is listed twice in the dropdown.
- Open either entry: both open the same direct message with yourself.
Further comments
Summary by CodeRabbit
-
Bug Fixes
- Fixed navbar room search so your own account no longer appears twice when searching by username.
- Improved navbar search result merging by better deduplicating direct-message results representing the same DM user.
-
Tests
- Added Jest coverage for the navbar search hook to verify both deduped (duplicate DM user) and appended (non-duplicate) results.