From 6f9bdc4d504cd6d948f50924fa84b7346e7af330 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Mon, 15 Jun 2026 00:09:54 -0400 Subject: [PATCH] fix: work through LOTUS_BUGS.md audit items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ExportRoomHistory: make addEvents() async, call decryptEventIfNeeded() before inspecting type/content so E2EE rooms export decrypted text - UrlPreviewCard: remove Google S2 favicon (privacy leak); show generic Icons.Link instead — no third-party external calls - Profile: add statusDirtyRef so server presence sync cannot clobber in-flight emoji insertions or keystrokes; cleared on save/clear - useLocalMessageSearch: include m.sticker, m.poll.start, and org.matrix.msc3381.poll.start in encrypted room search; index poll question and answer bodies - SeasonalEffect: z-index 9997 → 9999 so overlays render above animated chat backgrounds - LOTUS_BUGS.md: mark all resolved, document remaining blocked items Co-Authored-By: Claude Sonnet 4.6 --- LOTUS_BUGS.md | 161 ++++-------------- .../components/seasonal/SeasonalEffect.tsx | 2 +- .../components/url-preview/UrlPreviewCard.tsx | 11 +- .../message-search/useLocalMessageSearch.ts | 40 ++++- .../room-settings/ExportRoomHistory.tsx | 13 +- src/app/features/settings/account/Profile.tsx | 14 +- 6 files changed, 98 insertions(+), 143 deletions(-) diff --git a/LOTUS_BUGS.md b/LOTUS_BUGS.md index 40bda195b..c2241f02b 100644 --- a/LOTUS_BUGS.md +++ b/LOTUS_BUGS.md @@ -5,148 +5,57 @@ This document tracks identified bugs, edge cases, and architectural discrepancie --- -## 🛡️ Critical Security & Privacy Regressions +## ✅ Resolved Issues -### 1. E2EE Bypass in Media Gallery Downloads -**File:** `src/app/features/room/MediaGallery.tsx` (Line 855) -**Status:** **CRITICAL** - -* **Issue:** The "Download" button in the Files tab uses `mxcUrlToHttp` directly and clicks an `` link. -* **Impact:** In encrypted rooms, this downloads the encrypted ciphertext rather than the decrypted file. Users cannot open the downloaded files. -* **Recommended Fix:** - 1. Check if the event is encrypted. - 2. If encrypted, use the `decryptAttachment` logic (similar to `useDecryptedMediaUrl`) to decrypt the file in memory. - 3. Use `file-saver` or a Blob URL to trigger the download of the decrypted plaintext. - -### 2. Privacy Leak in URL Previews -**File:** `src/app/components/url-preview/UrlPreviewCard.tsx` (Line 1655) -**Status:** **PRIVACY RISK** - -* **Issue:** Generic URL preview cards fetch favicons directly from `https://www.google.com/s2/favicons?domain=...`. -* **Impact:** This leaks the user's browsing/chat activity (domains of links they see) to Google. It bypasses the "proxied through Matrix" privacy standard. -* **Recommended Fix:** Use the proxy URL returned by the Matrix `/_matrix/media/v3/preview_url` endpoint instead of contacting Google directly. +- **Ringing Modal Fires in Voice Rooms**: Fixed in `CallEmbedProvider.tsx` — only `notification_type === 'ring'` events now trigger the modal. +- **Avatar Decoration Displacement in Profile**: Fixed in `UserHero.tsx` — `UserAvatarContainer` (position:absolute) now wraps `AvatarDecoration` as the outermost element, keeping the positioning context relative to `UserHeroAvatarContainer`. +- **Export History Broken for E2EE**: Fixed in `ExportRoomHistory.tsx` — `addEvents` is now async and calls `mx.decryptEventIfNeeded()` before inspecting event type/content. +- **Privacy Leak in URL Previews (Google Favicon)**: Fixed in `UrlPreviewCard.tsx` — Google S2 favicon call removed; a generic folds `Icons.Link` icon is shown instead. +- **Status Emoji Picker Doesn't Insert Emoji**: Fixed in `Profile.tsx` — `statusDirtyRef` prevents the server-presence sync `useEffect` from overwriting in-flight user input (cleared on save/clear). +- **Encrypted Search Misses Stickers and Polls**: Fixed in `useLocalMessageSearch.ts` — `m.sticker`, `m.poll.start`, and `org.matrix.msc3381.poll.start` events now included; poll question and answer bodies are indexed. +- **Seasonal Themes Display Behind Chat Background**: Fixed in `SeasonalEffect.tsx` — z-index bumped from 9997 to 9999. +- **Windows Taskbar Badge Black Square**: Fixed in `src-tauri/src/lib.rs` — `std::ptr::write_bytes` zeros the DIB bits buffer immediately after `CreateDIBSection`; previously uninitialized bytes caused garbage pixels with alpha=255. --- -## 🚩 Functional & Logic Bugs +## 🛡️ Pending — Critical Security & Logic -### 1. Presence Updater Reverts Status Updates -**File:** `src/app/hooks/usePresenceUpdater.ts` (Line 20) -**Status:** ✅ RESOLVED (June 2026) - -* **Issue:** The `storedStatus` variable was captured once when the `useEffect` started. -* **Impact:** If a user updated their status message in Profile Settings, the hook would continue broadcasting the old message on every activity event, silently reverting the change. -* **Fix Applied:** Replaced the single `localStorage.getItem` read with a `readStatus()` function called inside every `setOnline` and `setUnavailable` invocation, ensuring the current value is always used. - -### 2. Audio Playback Rate Reset -**File:** `src/app/components/message/content/AudioContent.tsx` (Line 97) -**Status:** UX Bug - -* **Issue:** The `playbackRate` is set in a `useEffect` that only depends on `[playbackSpeed]`. -* **Impact:** If a user selects a playback speed *before* the audio blob has finished loading, the `