Skip to content

refactor: implement key package upload endpoint in WireNetwork - WPB-23048#4185

Open
johnxnguyen wants to merge 5 commits intodevelopfrom
refactor/key-packages-endpoint-wpb-23048
Open

refactor: implement key package upload endpoint in WireNetwork - WPB-23048#4185
johnxnguyen wants to merge 5 commits intodevelopfrom
refactor/key-packages-endpoint-wpb-23048

Conversation

@johnxnguyen
Copy link
Collaborator

@johnxnguyen johnxnguyen commented Jan 24, 2026

TaskWPB-23048 [iOS] Implement POST /mls/key-packages/self/{id}

Issue

Implement key package upload endpoint in WireNetwork.

Testing

Code not live yet.


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.

@johnxnguyen johnxnguyen changed the base branch from refactor/delete-client-wpb-23045 to develop January 24, 2026 08:34
@johnxnguyen johnxnguyen force-pushed the refactor/key-packages-endpoint-wpb-23048 branch from 569d25b to 9a45f08 Compare January 24, 2026 08:35
@johnxnguyen johnxnguyen force-pushed the refactor/key-packages-endpoint-wpb-23048 branch from 9a45f08 to bcdb1d7 Compare January 24, 2026 08:37
@github-actions
Copy link
Contributor

github-actions bot commented Jan 24, 2026

Test Results

2 740 tests   2 740 ✅  4m 20s ⏱️
  278 suites      0 💤
    2 files        0 ❌

Results for commit be90cd0.

♻️ This comment has been updated with latest results.

Summary: workflow run #21509099614
Allure report (download zip): html-report-27409

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.

left a todo, the rest looks good

.failure(
code: .badRequest,
label: "mls-protocol-error",
error: MLSAPIError.mlsProtocolError(message: "")
Copy link
Collaborator

Choose a reason for hiding this comment

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

todo: missing the message from failure response:

{
  "code": 400,
  "label": "mls-protocol-error",
  "message": "MLS protocol error"
}

you could do try catch:

do {
 try ResponseParser()....
} catch {
            if let failureResponse = error as? FailureResponseV0, where failureResponse.label == "mls-protocol-error" {
                throw MLSAPIError.mlsProtocolError(message: failureResponse.message)
            } else {
                throw error
            }
        }

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree that we should aim not to lose the underlying message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I understood the message to be "MLS protocol error", but do you think it could be actually something descriptive?

Copy link
Collaborator Author

@johnxnguyen johnxnguyen Jan 29, 2026

Choose a reason for hiding this comment

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

done 2c97f14

@johnxnguyen johnxnguyen requested a review from netbe January 29, 2026 08:10
Copy link
Contributor

@samwyndham samwyndham left a comment

Choose a reason for hiding this comment

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

Nice work!

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 5, 2026

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.

LGTM:)


/// Key package credential does not match qualified client ID

case mlsIdentityMismatch
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: attach the message from backend if any to help debugging

Suggested change
case mlsIdentityMismatch
case mlsIdentityMismatch(message: String)

}
}

func failure(
Copy link
Collaborator

Choose a reason for hiding this comment

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

praise: thanks for providing this

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