Skip to content

chat clears on tapping an omi app notification #2442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mdmohsin7 opened this issue May 25, 2025 · 1 comment · Fixed by #2462
Open

chat clears on tapping an omi app notification #2442

mdmohsin7 opened this issue May 25, 2025 · 1 comment · Fixed by #2462

Comments

@mdmohsin7
Copy link
Member

No description provided.

temimedical pushed a commit to temimedical/omi-fork that referenced this issue May 28, 2025
…emature selectedChatAppId reset in HomePageWrapper.initState() - This was causing a race condition where notification navigation would clear chat messages - The app ID was being reset to null before notification route processing completed - Now notifications properly navigate to chat without clearing existing messages - Fixes BasedHardware#2442: Chat notification tapping clears messages - Tested: Verified that tapping chat notifications preserves existing messages
temimedical pushed a commit to temimedical/omi-fork that referenced this issue May 28, 2025
…emature selectedChatAppId reset in HomePageWrapper.initState() - This was causing a race condition where notification navigation would clear chat messages - The app ID was being reset to null before notification route processing completed - Now notifications properly navigate to chat without clearing existing messages - Fixes BasedHardware#2442
mdmohsin7 added a commit that referenced this issue Jun 1, 2025
#2462)

## Problem
Chat notifications clear existing messages when tapped, causing users to
lose their conversation history.

## Root Cause
A race condition in `HomePageWrapper.initState()` was prematurely
resetting `selectedChatAppId` to `null` before notification route
processing completed.

## Solution
Remove the premature `setSelectedChatAppId(null)` call that was causing
the race condition.

## Testing
✅ Verified that tapping chat notifications now preserves existing
messages
✅ No regressions in normal app functionality

## Impact
- Fixes #2442: Chat notification tapping clears messages
- Improves user experience by preserving conversation history
- Minimal, targeted fix with no side effects

**Files changed:** 1 file, 3 lines removed

## Technical Details
The issue occurred because
`context.read<AppProvider>().setSelectedChatAppId(null)` was being
called in the `initState()` callback, which would execute before
notification navigation completed. This caused the MessageProvider to
clear messages when notifications tried to navigate to specific chats.

By removing this premature reset, notifications can now properly
navigate to chat without interfering with existing message state.
@mdmohsin7 mdmohsin7 reopened this Jun 1, 2025
@mdmohsin7
Copy link
Member Author

update backend /notifications route to save the notifications to messages collection
https://docs.omi.me/docs/developer/apps/Notifications

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant