Skip to content
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

chore: apply API v8 changes - WPB-15840 #2570

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

Conversation

caldrian
Copy link
Contributor

@caldrian caldrian commented Feb 20, 2025

TaskWPB-15840 [iOS] add and support API v8

Issue

A few endpoints changed with v8, this PR make the adjustments.


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.

Copy link
Contributor

github-actions bot commented Feb 20, 2025

Test Results

5 230 tests   5 228 ✅  9m 26s ⏱️
    4 suites      2 💤
    4 files        0 ❌

Results for commit 2936cd7.

♻️ This comment has been updated with latest results.

@datadog-wireapp
Copy link

datadog-wireapp bot commented Feb 20, 2025

Datadog Report

Branch report: chore/implement-v8-changes-WPB-15840
Commit report: 2c02580
Test service: wire-ios-mono

✅ 0 Failed, 5041 Passed, 2 Skipped, 4m 52.99s Total Time

@caldrian caldrian changed the title chore: handle API v8 changes - WPB-15840 chore: apply API v8 changes - WPB-15840 Feb 20, 2025
@@ -39,6 +39,7 @@ class CountSelfMLSKeyPackagesActionHandler: ActionHandler<CountSelfMLSKeyPackage
return nil
}

// TODO: .v8 requires ciphersuite or ciphersuites!
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes it looks like it. The optional query parameter was added from v5 but we never used it. I think it's fine to start using if from v8. The question is... which cipher suite should we pass?

@@ -39,6 +39,7 @@ class CountSelfMLSKeyPackagesActionHandler: ActionHandler<CountSelfMLSKeyPackage
return nil
}

// TODO: .v8 requires ciphersuite or ciphersuites!
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes it looks like it. The optional query parameter was added from v5 but we never used it. I think it's fine to start using if from v8. The question is... which cipher suite should we pass?

if apiVersion < .v8 {
path = "/conversations/\(identifier)/message-timer"
} else {
guard let domain = conversation.domain else { fatal("conversation has no domain") } // TODO: unit test?
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest to fallback to the local domain, which there should be (even though it's optional 🙃).

Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't crash the app if there was no domain

@@ -49,9 +49,17 @@ public extension ZMConversation {
guard let conversationId = remoteIdentifier?.transportString()
else { return completion(.failure(ReadReceiptModeError.noConversation)) }

let path: String
if apiVersion >= .v8 {
guard let domain else { return completion(.failure(ReadReceiptModeError.noConversation)) }
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: also here it'd be good to fallback on the local domain.

@@ -60,7 +60,7 @@ extension RegistrationStrategy: ZMSingleRequestTranscoder {
userInfoParser?.upgradeToAuthenticatedSession(with: $0)
}
registrationStatus.success()
} else {
} else { // TODO: handle new errors? 400: "invalid-domain" and 403: "condition-failed"
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we don't specifically handle these new errors, does the registration status still consider it an error? The login and registration flows are being re-written so probably doesn't make much sense to handle these errors if not absolutely necessary.

@@ -77,7 +77,7 @@ public final class TeamInvitationRequestStrategy: AbstractRequestStrategy {
)

request.add(ZMCompletionHandler(on: managedObjectContext, block: { [weak self] response in
self?.processResponse(response, for: email)
self?.processResponse(response, for: email) // TODO: handle new error? 403 "condition-failed"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there something to handle or would it end up as an error log?

Copy link
Contributor

@KaterinaWire KaterinaWire Feb 20, 2025

Choose a reason for hiding this comment

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

Agree, I don't think we have tickets or design changes to handle this error

@caldrian caldrian enabled auto-merge February 20, 2025 14:51
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