-
Notifications
You must be signed in to change notification settings - Fork 3
[Swift] Fix the Example app #137
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Left one suggestion (probably for later), and pushed SwiftLint fixes
self.fetchUsersTask = Task { @MainActor in | ||
do { | ||
users = try await api.users.forViewing.list() | ||
users = try await api.users.listWithViewContext(params: nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily for this PR, but are we able to make it so we can just call this like try await api.users.listWithViewContext()
and provide params if needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. That's implemented in the old API design where we had generic types to check if the params
argument is Optional
. I'll look into it later, potentially together with providing a better API regarding handling the new RequestExecutionError
type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or, we can just implement a few listWith[View|Edit|Embed]Context()
functions to Swift, if we can't have a general solution in short term.
c87af46
to
5fc35fe
Compare
I also rebased this on |
Note
This PR is built on top of #136
This PR also adds a
SafeRequestExecutor
type to avoid accidentally throwing random error instances into Rust code, which would cause crash (discussed in #136 (comment)).