Closed wimax-grapl closed 2 years ago
I was trying to get this fixed but it's not straightforward to update the tonic dependencies. The dependencies that must be updated are:
prost = "0.8"
tonic = "0.5"
tonic-build = "0.5"
The problem then is that there's a breaking change in the API. This impacts only the LazyAclClient because its client's type has changed.
https://github.com/selmeci/dgraph-tonic/blob/master/src/client/acl.rs#L41
with_interceptor
no longer returns a DgraphClient
error[E0308]: mismatched types
--> src/client/acl.rs:49:33
|
41 | let client = DgraphClient::with_interceptor(channel, move |mut req: Request<()>| {
| __________________________________________________________________-
42 | | let token = {
43 | | let access_jwt = access_jwt.lock().unwrap();
44 | | MetadataValue::from_str(&access_jwt).expect("gRPC metadata")
... |
47 | | Ok(req)
48 | | });
| |_____________- the found closure
49 | self.client.replace(client);
| ^^^^^^ expected struct `Channel`, found struct `tonic::codegen::InterceptedService`
|
= note: expected struct `v1_1_x::api::dgraph_client::DgraphClient<Channel>`
found struct `v1_1_x::api::dgraph_client::DgraphClient<tonic::codegen::InterceptedService<Channel, [closure@src/client/acl.rs:41:66: 48:14]>>`
Unfortunately, ILazyClient and other areas of the code have the expectation of Channel, and so it's not a straightforward change to fix this.
Due to
tonic-build
0.4, which depends onprost-types
0.7.I tried upgrading it to
tonic-build
0.5, but got 41 errors, mostly one of: