Using the realtime client, our onResult handler can currently use the request_id parameter to identify the request corresponding to an api call, if that call is successful. However, since the onResult callback is typed as @escaping (Result<Output, Error>) -> Void, we can't identify requests for api call failures in the same way.
Some example code demonstrating the issue:
connection = try! falClient.realtime.connect(
to: OptimizedLatentConsistency,
connectionKey: "ReproDemo",
throttleInterval: .milliseconds(0), // no need to throttle since i'm calling generate in response to a button tap
onResult: { (result: Result<LcmResponse, Error>) in
switch result {
case .success(let data):
// Can do things with data.requestId here
print(data.requestId!)
case .failure(let error):
// ISSUE: Can't tie this back to the originating request, since there's no way to access request_id
print(error)
}
}
)
Using the
realtimeclient, ouronResulthandler can currently use therequest_idparameter to identify the request corresponding to an api call, if that call is successful. However, since theonResultcallback is typed as@escaping (Result<Output, Error>) -> Void, we can't identify requests for api call failures in the same way.Some example code demonstrating the issue: