feat: show last message for ghost group (WPB-25285) - #4356
Open
sbakhtiarov wants to merge 1 commit into
Open
Conversation
Contributor
MohamadJaara
reviewed
Aug 3, 2026
Comment on lines
+559
to
+561
| DELETE FROM Message | ||
| WHERE conversation_id = :conversationId | ||
| AND content_type != 'ADMINLESS_DELETE_REMINDER'; |
Member
There was a problem hiding this comment.
at this point does the ADMINLESS_DELETE_REMINDER need to be a reminder vs a flag in the conv table (wll_be_deleted_at) this way it pinned to the bottom, and does not effect messages or wdyt ?
MohamadJaara
reviewed
Aug 3, 2026
Comment on lines
+69
to
+74
| conversations.combine(conversationRepository.observeAdminlessDeleteReminderPreviews()) { pagingData, reminders -> | ||
| if (reminders.isEmpty()) { | ||
| pagingData | ||
| } else { | ||
| val remindersByConversationId = reminders.associateBy { it.conversationId } | ||
| pagingData.map { conversation -> |
Member
There was a problem hiding this comment.
i am not sure why do we need to observe these separately vs folding this data with the preview
MohamadJaara
requested changes
Aug 3, 2026
MohamadJaara
left a comment
Member
There was a problem hiding this comment.
few things need to be cleared before merging. mainly why making this as a message and observing it separately in the use case complicating the flow, when we can make it a column in the conv that X conversaion will be deleted
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.
https://wearezeta.atlassian.net/browse/WPB-25285
What's new in this PR?
Issues
When a group loses all eligible admins, the backend sends an "adminless delete reminder" system event announcing that the group will be automatically deleted.
Until now this reminder was persisted but treated as
Unknownfor preview purposes, so the conversation list showed a stale/blank last message for these "ghost" groups instead of surfacing the pending-deletion state.Causes
ADMINLESS_DELETE_REMINDERmapped toMessagePreviewEntityContent.Unknown,so it never produced a meaningful preview.
real last message (or an empty draft) was shown regardless of the pending
deletion.
clearContentdeleted every message in a conversation, which would also wipethe reminder and lose the ghost-group state on clear.
Solutions
MessagePreviewEntityContent.AdminlessDeleteReminder(persistence) →MessagePreviewContent.AdminlessDeleteReminder(domain), wired throughMessageMapper.getAdminlessDeleteReminderPreviews(SQLDelight) +MessageDAO.observeAdminlessDeleteReminderPreviews(), returning the newestADMINLESS_DELETE_REMINDERper conversation (VISIBLE/DELETED), exposed viaConversationRepository.observeAdminlessDeleteReminderPreviews().ObserveConversationListDetailsWithEventsUseCaseImplandGetPaginatedFlowOfConversationDetailsWithEventsBySearchQueryUseCase, thereminder now overrides
lastMessagefor its conversation (non-archive only),while preserving unread-event counts and ordering.
clearContentnow preservesADMINLESS_DELETE_REMINDERrows(
AND content_type != 'ADMINLESS_DELETE_REMINDER') so clearing a ghost groupkeeps the pending-deletion indicator.
Dependencies
Needs releases with: