Skip to content

Fix deleted messages remaining visible in chat#28

Open
TiaraBasori wants to merge 5 commits into
iebb:masterfrom
TiaraBasori:fix/delete-message-cache-stale
Open

Fix deleted messages remaining visible in chat#28
TiaraBasori wants to merge 5 commits into
iebb:masterfrom
TiaraBasori:fix/delete-message-cache-stale

Conversation

@TiaraBasori

Copy link
Copy Markdown
Contributor

Summary

Invalidate the transcript memoization when messages are removed so deleted messages disappear immediately instead of remaining visible until the chat is reopened.

Root cause

The message list is mutated in place during deletion. Transcript caching only checked list identity, so it reused stale entries after the view model notified listeners.

Validation

  • flutter analyze lib/chat/chat_view.dart lib/chat/chat_view_model.dart
  • git diff --check

@TiaraBasori TiaraBasori left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Strict review found one remaining cache invalidation hole: mithkaChatHistoryCleared replaces messages and notifies listeners without advancing messageVersion, so _transcriptEntries can still reuse the old transcript when the list object/cache state lines up. I am patching this branch so every destructive transcript mutation invalidates the cache.

@TiaraBasori
TiaraBasori force-pushed the fix/delete-message-cache-stale branch from f9c7f08 to 3d4e2cb Compare July 12, 2026 04:21
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