Skip to content

🐛 fix: Clear cached messages and conversations on sign out#40

Open
TheRealAshik wants to merge 1 commit intopatchfrom
fix/clear-chat-on-logout-11760274166966647885
Open

🐛 fix: Clear cached messages and conversations on sign out#40
TheRealAshik wants to merge 1 commit intopatchfrom
fix/clear-chat-on-logout-11760274166966647885

Conversation

@TheRealAshik
Copy link
Copy Markdown
Contributor

Title: 🐞 fix: Clear cached messages and conversations on sign out

🐞 Bug Description

  • Current Behavior: Chat messages and conversations remain visible in the cache when a user logs out and switches to a different account.
  • Expected Behavior: Logging out should wipe the local cache, preventing the next user from seeing the previous user's messages and conversations.
  • Steps to Reproduce:
    1. Log into an account and open the chat screen.
    2. Go to Settings and Log Out.
    3. Log into a different account.
    4. Notice the previous user's chat messages are briefly (or fully) visible due to the local cache not being cleared.

🔧 Fix Approach

  • How it was fixed: Updated SettingsActivity.kt to inject CachedConversationDao and CachedMessageDao via Hilt. During the performLogout flow, it now calls deleteAll() on both DAOs before performing the sign-out request to authRepository.
  • Potential Side Effects: None anticipated. Clearing local cache on logout is standard behavior for proper multi-account isolation. The data remains safely stored remotely and will be re-fetched for the next logged-in user.

🧪 Verification

  • Bug is reproducible without this change
  • Bug is fixed with this change
  • Regression testing performed
  • Tests added/updated

✅ Build Status

  • Passed
  • Failed
  • N/A

🔗 References

  • Fixes #

PR created automatically by Jules for task 11760274166966647885 started by @TheRealAshik

- Add `CachedConversationDao` and `CachedMessageDao` via Hilt Injection into `SettingsActivity`.
- Update `performLogout` method to call `deleteAll()` on both DAOs. This correctly ensures that when a user switches accounts, the previously cached chat data is completely wiped out, removing stale chats from visibility.
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@supabase
Copy link
Copy Markdown

supabase bot commented Apr 10, 2026

This pull request has been ignored for the connected project apqvyyphlrtmuyjnzmuq because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Apr 10, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • app/src/main/kotlin/com/synapse/social/studioasinc/feature/settings/SettingsActivity.kt - No issues

The fix properly addresses the security concern - clearing cached messages and conversations on logout prevents data leakage between accounts. Implementation follows existing patterns with proper Hilt injection and coroutine-based async operations.


Reviewed by minimax-m2.5-20260211 · 82,891 tokens

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the SettingsActivity to clear local database caches during the logout process. It introduces dependencies on CachedConversationDao and CachedMessageDao, invoking their deleteAll methods within the performLogout function prior to signing out. I have no feedback to provide.

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 this pull request may close these issues.

1 participant