Closed saroar closed 2 years ago
I have test it on my api server working good only issue was from iOS client https://github.com/AddaMeSPB/EventEngine/blob/master/Tests/AppTests/Event/EventsRoutingTests.swift#L14
I am getting this decoding issue lots of time I am not sure its have issue or dont get proper error message becz
case let .imageUploadResponse(.success(imageURLString)):
guard let user: UserOutput = KeychainService.loadCodable(for: .user) else {
return .none
}
let attachment = AttachmentInOutPut(type: .image, userId: user.id, imageUrlString: imageURLString)
return .task {
do {
let attacment = try await environment.attachmentClient.updateUserImageURL(attachment)
return ProfileAction.attacmentResponse(.success(attacment))
} catch {
return ProfileAction.attacmentResponse(
.failure(
HTTPRequest.HRError.custom("cant upload attachment", error)
)
)
}
}
from clicnt I am trying to send like this I am 100% sure i dont have decoding issue at all
here my client https://github.com/AddaMeSPB/AddaMeIOS/blob/siteRouter/AddameSPM/Sources/AttachmentClient/AttachmentClient.swift here my live implement https://github.com/AddaMeSPB/AddaMeIOS/blob/siteRouter/AddameSPM/Sources/AttachmentClientLive/Live.swift#L91
and form this https://github.com/AddaMeSPB/AddaMeIOS/blob/siteRouter/AddameSPM/Sources/AttachmentClientLive/Live.swift#L84 I am getting sometimes error too
HRError
- description : "Failed to load the request: Optional(HTTPClientError.deadlineExceeded)"
▿ reason : Optional<Error>
▿ some : HTTPClientError.deadlineExceeded
- code : AsyncHTTPClient.HTTPClientError.(unknown context at $104271798).Code.deadlineExceeded
testing from server side no issue https://github.com/AddaMeSPB/AddaMeAuth/blob/siteRouter/Tests/AppTests/AttachmentTests.swift#L26
@saroar It looks like the server is sending back a "deadline exceeded" error, which is why decoding is failing.
You can see the definition here:
I'm not familiar with this error or how to work around it, but I don't think it's a bug with our library. Can you ask someone in a community more familiar with the HTTPClient
library, and whatever server code you are using to serve up that response? They may be able to help you debug. If it turns out to be an issue with our library we'd be happy to address! We just need a reproduction.
Since this doesn't appear to be a bug in our library, I'm going to close it. But if you do believe there's a bug in our library, please file a new issue with a reproduction for us to work with and instructions on how to reproduce. Without steps to reproduce, we really don't have much of an ability to try to fix.
My playground code which dont have any issue playground code here https://gist.github.com/saroar/a1bab728f4292c54cb76085a633c6a3c my client iOS app dont send any request to server becz its not decoding my query https://github.com/AddaMeSPB/AddaMeIOS/blob/siteRouter/AddameSPM/Sources/EventView/EventsReducer.swift#L112 error coming from decoding from this https://github.com/pointfreeco/swift-url-routing/blob/main/Sources/URLRouting/Client/Client.swift#L53