Skip to content

feat: initiate reset broken mls conversation - WPB-18800 #3348

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

Open
wants to merge 37 commits into
base: develop
Choose a base branch
from

Conversation

dmitrysimkin
Copy link
Contributor

@dmitrysimkin dmitrysimkin commented Jul 16, 2025

TaskWPB-18800 [IOS] Initiate reset broken MLS conversations

Issue

Please describe the issue.

Optional: add details about technical approach, solutions etc.

Optional: reference dependencies to other pull requests etc.

Testing

Describe how to test.

Optional: attachments like images, videos, etc.


Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@dmitrysimkin dmitrysimkin requested a review from netbe July 16, 2025 14:07
@dmitrysimkin dmitrysimkin marked this pull request as ready for review July 18, 2025 14:04
Copy link
Contributor

github-actions bot commented Jul 18, 2025

Test Results

    7 files    989 suites   9m 18s ⏱️
7 524 tests 7 496 ✅ 27 💤 1 ❌
7 525 runs  7 498 ✅ 27 💤 0 ❌

For more details on these failures, see this check.

Results for commit ea1f19f.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Jul 18, 2025

Datadog Report

Branch report: feature/initiate-reset-broken-MLS-convo-WPB-18800
Commit report: 786bc49
Test service: wire-ios-mono

✅ 0 Failed, 7493 Passed, 27 Skipped, 4m 8.74s Total Time

Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

looks good, left a couple comments before approving

"A referenced leaf node index points to a blank or non-existing node: \(message)"

case let .mlsInvalidLeafNodeSignature(message):
"TBD" // TODO:
Copy link
Collaborator

Choose a reason for hiding this comment

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

todo: here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 713 to 723
initiateResetMLSConversationUseCaseFactory: { [weak self] context in
guard let self else {
fatal("userSession not reachable")
}
return makeInitiateResetMLSConversationUseCase(context: context)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: i know we talked about this? but just to double check, is this the only way?

Maybe could be good to leave a comment here why this is necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean pass it from ZMUserSession or use factory block instead of passing already created use case instance?

Copy link
Collaborator

Choose a reason for hiding this comment

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

ok actually what would be nice is to leave a comment why we do it:

"Passing useCase from WireDomain to WireRequestStrategy's MessageSender"

Base automatically changed from feat/WPB-18635-mls-reset-conversation to release/cycle-4.2 July 23, 2025 10:25
@dmitrysimkin dmitrysimkin requested a review from netbe July 23, 2025 13:28
Copy link
Contributor

@jullianm jullianm left a comment

Choose a reason for hiding this comment

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

Looks good, nice work

@dmitrysimkin dmitrysimkin changed the base branch from release/cycle-4.2 to develop July 24, 2025 16:24
@dmitrysimkin dmitrysimkin changed the base branch from develop to release/cycle-4.2 July 24, 2025 16:24
@dmitrysimkin dmitrysimkin force-pushed the feature/initiate-reset-broken-MLS-convo-WPB-18800 branch from 1a8b9b0 to 51bdeaf Compare July 24, 2025 17:05
@dmitrysimkin dmitrysimkin changed the base branch from release/cycle-4.2 to develop July 24, 2025 17:06
@dmitrysimkin dmitrysimkin reopened this Jul 25, 2025
@netbe netbe changed the title feat: Initiate reset broken mls convo - WPB-18800 feat: initiate reset broken mls conversation - WPB-18800 Jul 25, 2025
Copy link
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

found just one issue with establish group, then we're good

let users = await conversationLocalStore.localParticipantsAsMLSUsers(in: conversation)
_ = try await mlsService.establishGroup(for: groupID, with: users, removalKeys: nil)

WireLogger.mls.info("Initiate reset broken MLS conversation use case finished")
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion:
add conversationID as attribute to all logs so we know which conversation we're talking about
i.e.:

      .conversationId: message.conversation?.qualifiedID?.safeForLoggingDescription ?? "<nil>"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added


// re-create group and re-add all participants
let users = await conversationLocalStore.localParticipantsAsMLSUsers(in: conversation)
_ = try await mlsService.establishGroup(for: groupID, with: users, removalKeys: nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue: localParticipants returns all participants including selfUser and establishGroup add the users and internally adds also self. Use localParticipantsExcludingSelf if we use establishGroup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 713 to 723
initiateResetMLSConversationUseCaseFactory: { [weak self] context in
guard let self else {
fatal("userSession not reachable")
}
return makeInitiateResetMLSConversationUseCase(context: context)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

ok actually what would be nice is to leave a comment why we do it:

"Passing useCase from WireDomain to WireRequestStrategy's MessageSender"

@dmitrysimkin dmitrysimkin requested a review from netbe July 25, 2025 11:02
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.

3 participants