fix: label self-conversations consistently across clients - #47
Merged
Merged
Conversation
added 4 commits
September 2, 2026 05:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Fix OpenChat self-conversations displaying Unknown. The bug is client-side, not caused by a missing Google profile name: mobile list code looked only for a participant other than the signed-in user, which cannot exist in a self-only direct chat. Recognize self-only direct conversations explicitly, display the concise title 'Myself', retain the signed-in participant for avatar data, make the label consistent across native iOS, RN-web mobile/desktop, forwarding, search, empty state, chat header, and legacy web, preserve all ordinary DM/group behavior, add regression tests, then push through review and CI. Track the work as OpenChat-5mn6.
What Changed
Risk Assessment
✅ Low: The change is well-bounded and now enforces the self-conversation title and avatar-participant invariant across the required mobile, RN-web, forwarding, search, empty-state, header, and legacy-web paths while preserving ordinary DM/group naming behavior.
Testing
After restoring missing locked dependencies, the focused web/mobile helper regressions passed, the RN-web production export bundled, and real desktop/mobile renders verified “Myself” across the list, retained self-avatar, header, empty state, and search while preserving ordinary DM/group labels; legacy web evidence also shows the corrected label, while native iOS could not run because Xcode and a simulator runtime are unavailable.
/var/folders/7w/cfzyk2q1135bh_qr4jsm7ft40000gp/T/no-mistakes-evidence/01M1GZ2MBX2WQZ8Y4R2EWYGA6D/rn-web-mobile-conversation-list.png)/var/folders/7w/cfzyk2q1135bh_qr4jsm7ft40000gp/T/no-mistakes-evidence/01M1GZ2MBX2WQZ8Y4R2EWYGA6D/rn-web-mobile-self-chat.png)/var/folders/7w/cfzyk2q1135bh_qr4jsm7ft40000gp/T/no-mistakes-evidence/01M1GZ2MBX2WQZ8Y4R2EWYGA6D/rn-web-mobile-search-self-chat.png)/var/folders/7w/cfzyk2q1135bh_qr4jsm7ft40000gp/T/no-mistakes-evidence/01M1GZ2MBX2WQZ8Y4R2EWYGA6D/rn-web-desktop-self-chat.png)/var/folders/7w/cfzyk2q1135bh_qr4jsm7ft40000gp/T/no-mistakes-evidence/01M1GZ2MBX2WQZ8Y4R2EWYGA6D/legacy-web-self-chat.png)Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 4 issues found → auto-fixed ✅
apps/web/src/pages/ChatPage.tsx:97- The required criterion “make the label consistent across … chat header, and legacy web” is absent here. Opening a self-only direct chat still selects the signed-in participant and rendersuserDisplayName(...), producing a profile-derived label such as “Jacob (You)” while the list says “Myself”. Use the self-conversation helper for the legacy header while retainingdirectParticipantfor profile/avatar behavior.apps/mobile/src/screens/SearchScreen.tsx:169- The required criterion “make the label consistent across … search” remains reachable. The new branch labels only conversation hits; a message hit from a self-chat still rendersDM with ${senderName}here, and legacy web renders “Direct message”. Also, the conversation-hit avatar still discards the signed-in participant becauseotherexcludes self. Resolve the hit's conversation and apply the self label/participant invariant across both search clients.apps/mobile/src/components/ChatEmptyState.tsx:48- The required criterion says the concise self-conversation label must be consistent in the empty state, but the changed self branch renders “Messages here are just for you” and never displays “Myself”. Use the shared self title in this copy, unless this intentionally different wording is explicitly approved.apps/mobile/src/utils/conversationDisplay.ts:30- The criterion requires self-only direct conversations to display “Myself”, but this new helper returns an explicit conversation title before checking self identity. The server permits a title when creating a direct conversation, so a titled self-chat remains a reachable exception. Check self first; ordinary titled DMs and groups can retain their current behavior.🔧 Fix: Fix self-chat labels across headers and search
✅ Re-checked - no issues remain.
apps/mobile- Native iOS and RN-web mobile/desktop were not visually demonstrated. The Expo web development server opened its port but stalled without serving a rendered page, so the available product-level screenshot covers only legacy web. Mobile helper regression tests pass and all required mobile call sites use the helper, but a reviewer must decide whether to proceed with CI/device validation or require additional native/RN-web visual evidence first.Inspectedgit diff bfe67477d26219592dcf5d27f063b20c48962a25..80fd5c9dad6821bc78238ad11d6c687d507d9bf7and every self-conversation helper call site.Rancd apps/server && npx vitest run test/conversationDisplay.test.ts; the first attempt exposed missing isolated-worktree dependencies.Rannpm ci, then rerancd apps/server && npx vitest run test/conversationDisplay.test.tssuccessfully.Launchedapps/webwithVITE_NOOS_URL=http://127.0.0.1:41851 npm run dev --workspace=apps/web -- --host 127.0.0.1against a fixture API, authenticated through the client session flow, selected the self-chat, and verified the rendered list/header and preserved ordinary DM/group rows.Ran the evidence capture scriptnode /var/folders/7w/cfzyk2q1135bh_qr4jsm7ft40000gp/T/no-mistakes-evidence/01M1GZ2MBX2WQZ8Y4R2EWYGA6D/capture-legacy-web.mjs.Attempted RN-web rendering withEXPO_PUBLIC_OPENCHAT_URL=http://127.0.0.1:41851 EXPO_PUBLIC_NOOS_URL=http://127.0.0.1:41851 npx expo start --web --port 19006; Metro opened the port but did not serve a page.Removed generatednode_modulesandapps/mobile/.expotest artifacts, then confirmed the worktree remained clean withgit status --short --branch.🔧 Fix: Fix RN-web bundling and self-chat header crash
1 warning still open:
apps/mobile- Native iOS could not be visually exercised because this host has only Apple Command Line Tools and no Xcode or simulator runtime. The same React Native components were verified through the production RN-web export, including the list, retained self-avatar, chat header, empty state, and search surfaces, but a reviewer must decide whether that shared-code evidence is sufficient or require a later device/TestFlight check.npx --yes vitest@2.1.9 run apps/server/test/conversationDisplay.test.ts(initial setup attempt; blocked by missingexpo/tsconfig.base)npm ci --ignore-scripts(restored locked test/build dependencies)npx vitest run apps/server/test/conversationDisplay.test.tsEXPO_PUBLIC_OPENCHAT_URL=http://127.0.0.1:41851 EXPO_PUBLIC_NOOS_URL=http://127.0.0.1:41851 npm run export:web:desktop --workspace=openchat-mobilenode …/mock-openchat-server.mjsplusnode …/capture-rn-web.mjs(rendered RN-web desktop/mobile, opened the self-chat, and searched it)Visual inspection of the RN-web desktop, mobile list, mobile chat, mobile search, and legacy-web screenshotsxcrun simctl list devices availableandxcodebuild -version(confirmed native iOS testing unavailable on this host)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.