Skip to content

fix: show MLS-specific learn more link for empty key packages - WPB-24214#5023

Open
netbe wants to merge 4 commits into
developfrom
feat/show-learn-more-empty-packages-WPB-24214
Open

fix: show MLS-specific learn more link for empty key packages - WPB-24214#5023
netbe wants to merge 4 commits into
developfrom
feat/show-learn-more-empty-packages-WPB-24214

Conversation

@netbe

@netbe netbe commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator
StoryWPB-24214 [iOS] Learn more link shows wrong info on support article

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:

  • Added ZMSystemMessageTypeFailedToAddParticipantsMLS, a new case on the existing ZMSystemMessageType enum (no Core Data migration needed, since systemMessageType is already a persisted attribute).
  • Threaded this reason from MLSService.MLSAddMembersError.failedToClaimKeyPackages through both the legacy request-strategy path (ConversationParticipantsService) and the WireDomain live-sync path (CreateGroupConversationUseCase/CreateChannelUseCase) up to the system message append call.
  • ConversationFailedToAddParticipantsSystemMessageCellDescription now shows WireURLs.shared.mlsInfo instead of WireURLs.shared.unreachableBackendInfo when the reason is the new MLS type. Body text is unchanged (already generic, not federation-specific wording).

Testing

  1. Create a user without an MLS client using WireAPIDebugger, and accept the connection request.
  2. Try to add that user to an existing group, or try to create a new MLS conversation with them.
  3. Confirm the "X could not be added to the group" message now shows a "Learn more" link pointing to the MLS support article, not the federation/unreachable-backends one.

Checklist

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

Copilot AI review requested due to automatic review settings July 16, 2026 22:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ZMSystemMessageTypeFailedToAddParticipantsMLS and plumbed it through MLS key-package-claim failure paths to system message creation.
  • Updated conversation system message rendering to treat .failedToAddParticipantsMLS like .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.

@netbe
netbe requested review from a team, acv-w and johnxnguyen and removed request for a team July 17, 2026 14:45
@netbe
netbe requested review from David-Henner and removed request for johnxnguyen July 17, 2026 14:45
@github-actions

Copy link
Copy Markdown
Contributor

Test Results – batch 0

    2 files    447 suites   2m 38s ⏱️
2 504 tests 2 477 ✅ 27 💤 0 ❌
2 505 runs  2 478 ✅ 27 💤 0 ❌

Results for commit 7533cfc.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results – batch 1

    2 files    355 suites   4m 8s ⏱️
3 352 tests 3 351 ✅ 0 💤 1 ❌
3 352 runs  3 352 ✅ 0 💤 0 ❌

For more details on these failures, see this check.

Results for commit 7533cfc.

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.

2 participants