Closed sampajano closed 1 year ago
@stanley-cheung Hey Stanley, i think maybe this is a TS bug from day 1. I wonder if there's any concern if we make this fix (probably be breaking for some existing clients but should be easy to fix) and just bump the "minor" version (to 1.5)? Thanks!
Making this a draft for now.. See discussion here: https://github.com/grpc/grpc-web/issues/1309#issuecomment-1373045693
Please see https://github.com/grpc/grpc-web/issues/1309#issuecomment-1373045693 — I realized that this fix will create additional unnecessary troubles for callers so it's not idea. Dropping it for now.
Better ideas that does not involve a big breaking change would be welcome!
IMPORTANT: This will be a BREAKING change for some existing users, but hopefully in a good way because now the return type is more accurately reflecting the runtime behavior.
In reality, both error and response can be null.
JS Defintion: https://github.com/grpc/grpc-web/blob/e49389873d887d15ab2870288f620aa2f15b3b85/javascript/net/grpc/web/abstractclientbase.js#L50-L51
Callsites: https://github.com/grpc/grpc-web/blob/e49389873d887d15ab2870288f620aa2f15b3b85/javascript/net/grpc/web/grpcwebclientbase.js#L249
https://github.com/grpc/grpc-web/blob/e49389873d887d15ab2870288f620aa2f15b3b85/javascript/net/grpc/web/grpcwebclientbase.js#L284
Fixes #1309