-
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: Update conversation Proteus verification status (WPB-1789) #2157
feat: Update conversation Proteus verification status (WPB-1789) #2157
Conversation
Datadog ReportBranch report: ✅ |
Codecov Report
@@ Coverage Diff @@
## develop #2157 +/- ##
=============================================
- Coverage 57.98% 57.97% -0.01%
Complexity 21 21
=============================================
Files 1064 1064
Lines 40319 40414 +95
Branches 3733 3738 +5
=============================================
+ Hits 23377 23430 +53
- Misses 15330 15372 +42
Partials 1612 1612
... and 11 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
@@ -269,6 +275,11 @@ data class Conversation( | |||
) | |||
} | |||
|
|||
data class ProteusVerificationData( | |||
val conversationId: ConversationId, | |||
val currentVerificationStatus: VerificationStatus, |
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.
suggestion:
val currentVerificationStatus: VerificationStatus, | |
val verificationStatus: VerificationStatus, |
data class ProteusVerificationData( | ||
val conversationId: ConversationId, | ||
val currentVerificationStatus: VerificationStatus, | ||
val isActuallyVerified: Boolean |
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.
question: what does this mean?
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.
conversationId
is conversationId, currentVerificationStatus
is the verification status of the conversation that is currently stored in DB, isActuallyVerified
Boolean if the conversation actually should be verified or not (calculated by checking all the clients of the conversation).
It's a good idea to add some docs :)
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.
so isn't better to store the new updated value then return the aggregated value? still I think it's confusing that we're returning two values that one is kinda out dated.
@@ -281,6 +281,14 @@ interface ConversationRepository { | |||
* @return **true** if the protocol was changed or **false** if the protocol was unchanged. | |||
*/ | |||
suspend fun updateProtocolLocally(conversationId: ConversationId, protocol: Conversation.Protocol): Either<CoreFailure, Boolean> | |||
|
|||
suspend fun getConversationsProteusVerificationDataByClientId( |
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.
suspend fun getConversationsProteusVerificationDataByClientId( | |
suspend fun getConversationsProteusVerificationData( |
clientId: ClientId | ||
): Either<StorageFailure, List<Conversation.ProteusVerificationData>> | ||
|
||
suspend fun updateProteusVerificationStatuses( |
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.
suspend fun updateProteusVerificationStatuses( | |
suspend fun updateProteusVerificationStatus( |
@@ -51,7 +51,8 @@ SELECT | |||
user_message_timer, | |||
archived, | |||
archived_date_time, | |||
verification_status | |||
verification_status, |
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.
tbh storing the mls verification status for members doesn't make sense. why we need it? it's already in the CoreCrypto we only need to fetch it. keeping it up to dated is risky.
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 how two concerns, please review and if necessary we can sync online.
@@ -79,3 +79,32 @@ SELECT * | |||
WHERE user_id IN | |||
(SELECT user FROM Member WHERE conversation = :conversation_id AND user_id IN :userIdList) | |||
AND is_valid = 1; | |||
|
|||
CREATE TRIGGER updateConversationProteusVerificationStatus |
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.
🤘🙌🔥
@@ -400,3 +403,25 @@ DELETE FROM Message WHERE conversation_id = :conversationId; | |||
|
|||
selectChanges: | |||
SELECT changes(); | |||
|
|||
CREATE TRIGGER addMessageAfterProteusVerificationStatusChange |
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.
🔥
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 man, awesome 🤩 🔥
What's new in this PR?
Issues
When all the clients that belong to conversation are Proteus-verified, such a conversation should become a "Proteus verified" + need to add SystemMessage to that conversation informing user that conversation is Verified.
Solutions
proteus_verification_status
conversationID
with currentproteus_verification_status
andif that conversation should be verified
UpdateClientVerificationStatusUseCase
to use select from#2
, update conversations if needed and add SystemMessages to it.Needs releases with: