Persist conversation drafts - #144
Merged
Merged
Conversation
Contributor
Greptile SummaryThe PR adds identity-scoped, per-conversation text draft persistence and integrates restoration, debounced autosaving, lifecycle flushes, send-time clearing, chat-list previews, and deletion cleanup.
Confidence Score: 5/5The PR appears safe to merge. The previously reported orphan-draft issue is addressed by explicit post-delete cleanup, while the conditional parent check preserves drafts belonging to a concurrently recreated conversation; no blocking failure remains. Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Composer as MessagingView
participant Autosave as DraftAutosaveController
participant Repo as MessageRepository
participant DB as Identity-scoped SQLite
participant Chats as ChatsViewModel
User->>Composer: Edit text
Composer->>Autosave: textChanged(text)
Autosave->>Repo: saveDraft(text, conversationHash)
Repo->>DB: Upsert draft
Repo-->>Chats: draftChanged notification
Chats->>Repo: Reload conversations and drafts
Repo-->>Chats: Draft-aware snapshot
User->>Composer: Send message
Composer->>Autosave: clearImmediately()
Autosave->>Repo: clearDraft(conversationHash)
Repo->>DB: Delete draft
User->>Chats: Delete conversation
Chats->>Repo: deleteConversation(hash)
Repo->>DB: Delete canonical conversation and messages
Repo->>DB: Delete draft only if parent remains absent
Reviews (2): Last reviewed commit: "fix: preserve recreated conversation dra..." | Re-trigger Greptile |
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.
Summary
Draft:previewFixes #143
Verification
Columbabuild: passedColumba-ModelBcompile build: passedScope
Draft persistence is text-only. Attachments, images, files, and reply context are intentionally not stored as part of drafts.
Risk and rollback
The schema addition is app-owned and idempotent, with no change to the pinned LXMF package migration chain. Reverting this PR leaves the draft table unused; existing message and conversation data remain unchanged.