fix: show MLS-specific learn more link for empty key packages - WPB-24214#5023
fix: show MLS-specific learn more link for empty key packages - WPB-24214#5023netbe wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new MLS-specific “failed to add participants” system-message type so that, when adding members fails due to missing MLS key packages, the UI “Learn more” link points to the MLS support article (instead of the federation/unreachable-backend article). It threads the new reason through both WireDomain use cases and the legacy request-strategy flow, and updates UI rendering + tests accordingly.
Changes:
- Added
ZMSystemMessageTypeFailedToAddParticipantsMLSand plumbed it through MLS key-package-claim failure paths to system message creation. - Updated conversation system message rendering to treat
.failedToAddParticipantsMLSlike.failedToAddParticipants, but with an MLS-specific “Learn more” URL. - Added/updated unit + snapshot tests and reference images to cover the new system message type and link behavior.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| WireDomain/Tests/WireDomainTests/UseCases/CreateGroupConversationUseCaseTests.swift | Expects MLS key-package failure to produce .failedToAddParticipantsMLS. |
| WireDomain/Tests/WireDomainTests/UseCases/CreateChannelUseCaseTests.swift | Expects MLS key-package failure to produce .failedToAddParticipantsMLS. |
| WireDomain/Sources/WireDomain/UseCases/CreateGroupConversationUseCase.swift | Passes MLS-specific system message type for “failed to claim key packages”. |
| WireDomain/Sources/WireDomain/UseCases/CreateChannelUseCase.swift | Passes MLS-specific system message type for “failed to claim key packages”. |
| wire-ios/Wire-iOS/Sources/UserInterface/Conversation/Content/Cells/ConfigurationMessageCell/Components/ConversationSystemMessageCellDescription.swift | Routes the new system message type to the same cell description as the existing failure. |
| wire-ios/Wire-iOS/Sources/UserInterface/Conversation/Content/Cells/ConfigurationMessageCell/Components/ConversationMessageFailedRecipientsCellDescription.swift | Adds an attributed “Learn more” link variant pointing to WireURLs.shared.mlsInfo. |
| wire-ios/Wire-iOS/Sources/UserInterface/Conversation/Content/Cells/ConfigurationMessageCell/Components/ConversationFailedToAddParticipantsSystemMessageCellDescription.swift | Chooses MLS vs unreachable-backend “Learn more” link based on system message type. |
| wire-ios/Wire-iOS.xcodeproj/project.pbxproj | Registers the new unit test file in the test target. |
| wire-ios/Wire-iOS Tests/ReferenceImages/ConversationSystemMessageTests/testFailedToAddParticipantsMLS.320-0.png | Adds snapshot reference image (Git LFS pointer) for MLS failure message. |
| wire-ios/Wire-iOS Tests/ReferenceImages/ConversationSystemMessageTests/testFailedToAddParticipantsMLS.375-0.png | Adds snapshot reference image (Git LFS pointer) for MLS failure message. |
| wire-ios/Wire-iOS Tests/ReferenceImages/ConversationSystemMessageTests/testFailedToAddParticipantsMLS.414-0.png | Adds snapshot reference image (Git LFS pointer) for MLS failure message. |
| wire-ios/Wire-iOS Tests/ConversationMessageCell/ConversationSystemMessageTests.swift | Adds a snapshot test for .failedToAddParticipantsMLS. |
| wire-ios/Wire-iOS Tests/ConversationMessageCell/ConversationFailedToAddParticipantsSystemMessageCellDescriptionTests.swift | Verifies “Learn more” URL selection for default vs MLS-specific reason. |
| wire-ios-request-strategy/Sources/Request Strategies/Conversation/ConversationParticipantsServiceTests.swift | Asserts inserted system message type is .failedToAddParticipantsMLS for key-package-claim failures. |
| wire-ios-request-strategy/Sources/Request Strategies/Conversation/ConversationParticipantsService.swift | Threads ZMSystemMessageType through the “failed to add some users” error to system message insertion. |
| wire-ios-data-model/Source/Public/ZMMessage.h | Adds ZMSystemMessageTypeFailedToAddParticipantsMLS enum case (persisted systemMessageType). |
| wire-ios-data-model/Source/Model/Conversation/ZMConversation+SystemMessages.swift | Allows appending “failed to add users” system messages with a configurable system message type. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Test Results – batch 0 2 files 447 suites 2m 38s ⏱️ Results for commit 7533cfc. |
Test Results – batch 1 2 files 355 suites 4m 8s ⏱️ For more details on these failures, see this check. Results for commit 7533cfc. |
Issue
When adding a member to an MLS conversation fails because the backend returns no MLS key packages for them (no MLS client, or an MLS client with no key packages published), we currently show the same "Learn more" link as a genuine Federation/unreachable-backend failure. That's misleading, since the two causes are unrelated and the federation article doesn't explain the actual problem.
Since the client can't yet distinguish "no MLS client" from "backend unreachable" purely from the empty key-packages response, we instead stop mapping this case to the generic Federation system message and route it to a new, MLS-specific system message type with a link to the MLS support article — mirroring the approach Android shipped in wireapp/wire-android#4659.
Technical approach:
ZMSystemMessageTypeFailedToAddParticipantsMLS, a new case on the existingZMSystemMessageTypeenum (no Core Data migration needed, sincesystemMessageTypeis already a persisted attribute).MLSService.MLSAddMembersError.failedToClaimKeyPackagesthrough both the legacy request-strategy path (ConversationParticipantsService) and the WireDomain live-sync path (CreateGroupConversationUseCase/CreateChannelUseCase) up to the system message append call.ConversationFailedToAddParticipantsSystemMessageCellDescriptionnow showsWireURLs.shared.mlsInfoinstead ofWireURLs.shared.unreachableBackendInfowhen the reason is the new MLS type. Body text is unchanged (already generic, not federation-specific wording).Testing
Checklist
[WPB-XXX].