File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 11## 4.1.0
2- * Add a ` serverInterceptors ` argument to ` ConnectionServer ` . These interceptors are acting
2+ * Add a ` serverInterceptors ` argument to ` ConnectionServer ` . These interceptors are acting
33 as middleware, wrapping a ` ServiceMethod ` invocation.
4+ * Make sure that ` CallOptions.mergeWith ` is symmetric: given ` WebCallOptions `
5+ it should return ` WebCallOptions ` .
46
57## 4.0.4
68
Original file line number Diff line number Diff line change @@ -86,6 +86,11 @@ class CallOptions {
8686
8787 CallOptions mergedWith (CallOptions ? other) {
8888 if (other == null ) return this ;
89+
90+ if (other is WebCallOptions ) {
91+ return other.mergedWith (this );
92+ }
93+
8994 final mergedMetadata = Map .of (metadata)..addAll (other.metadata);
9095 final mergedTimeout = other.timeout ?? timeout;
9196 final mergedProviders = List .of (metadataProviders)
Original file line number Diff line number Diff line change @@ -34,15 +34,20 @@ void main() {
3434 });
3535
3636 test ('WebCallOptions mergeWith CallOptions returns WebCallOptions' , () {
37- final options =
37+ final options1 =
3838 WebCallOptions (bypassCorsPreflight: true , withCredentials: true );
3939 final metadata = {'test' : '42' };
40- final mergedOptions =
41- options.mergedWith (CallOptions (metadata: metadata)) as WebCallOptions ;
40+ final options2 = CallOptions (metadata: metadata);
41+ final mergedOptions1 = options1.mergedWith (options2) as WebCallOptions ;
42+ final mergedOptions2 = options2.mergedWith (options1) as WebCallOptions ;
4243
43- expect (mergedOptions.metadata, metadata);
44- expect (mergedOptions.bypassCorsPreflight, true );
45- expect (mergedOptions.withCredentials, true );
44+ expect (mergedOptions1.metadata, metadata);
45+ expect (mergedOptions1.bypassCorsPreflight, true );
46+ expect (mergedOptions1.withCredentials, true );
47+
48+ expect (mergedOptions2.metadata, metadata);
49+ expect (mergedOptions2.bypassCorsPreflight, true );
50+ expect (mergedOptions2.withCredentials, true );
4651 });
4752
4853 test (
You can’t perform that action at this time.
0 commit comments