-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: message draft [WPB-1021] #2664
Conversation
|
||
import com.wire.kalium.logic.data.message.mention.MessageMention | ||
|
||
data class MessageDraft( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if instead of adding nullables, we create sealed implementations?
DraftMessage.Reply
DraftMessage.Edit
DraftMessage.Simple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not worth it because it can be divided only into 2 types which one doesn't have quoted Id and one which has. Rest variables can be combined (edited message can have quote, mentions) and at the end it will be merged into one entity object saved in db
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. I forgot about the possibility of it being both Reply and Edit at the same time.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2664 +/- ##
=============================================
+ Coverage 58.71% 58.78% +0.06%
Complexity 7 7
=============================================
Files 1188 1199 +11
Lines 46523 46716 +193
Branches 4386 4389 +3
=============================================
+ Hits 27314 27460 +146
- Misses 17250 17291 +41
- Partials 1959 1965 +6
... and 8 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
CREATE TABLE MessageDrafts ( | ||
conversation_id TEXT AS QualifiedIDEntity NOT NULL, | ||
text TEXT, | ||
edit_message_id TEXT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the reply and edit also be also a FOREIGN KEY to a message ID ? in that case if the message got deleted or changed we can change how draft will react
we can for example set the edit_message_id or qouted_message_id to null when deleted on changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work as always
Datadog ReportAll test runs ✅ 2 Total Test Services: 0 Failed, 2 Passed Test Services
|
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Implemented message draft table to save message drafts when user leaves conversation screen before sending message. It saves