Commit Graph

147 Commits

Author SHA1 Message Date
minoic 20bd1737c4
update: upgrade web package to v1.1.0 2024-12-16 09:15:12 -08:00
minoic 609d725e34
update: use if instead of switch case in xhr_transport.dart 2024-12-16 09:15:12 -08:00
minoic 8313a4dc79
update: dart format xhr_transport.dart and update dart sdk to v3.4.0 in workflows 2024-12-16 09:15:12 -08:00
minoic d49f9f7414
update: use dart.library.js_interop in place of dart.library.html 2024-12-16 09:15:12 -08:00
minoic 74897b2cc9
update: Migrate off legacy JS/HTML apis 2024-12-16 09:15:04 -08:00
Moritz 04ba68eb91
Rev package:lints (#740)
* Rev package:lints

* Add changelog

* Run CI on 3.5.0

* Test with 3.2.0

* Update .github/workflows/dart.yml

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>

* Update .github/workflows/dart.yml

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>

---------

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
2024-10-01 10:46:38 +02:00
Kevin Moore f8bbdce629
ignore unreachable_switch_default in weird switch case (#737) 2024-09-24 12:07:42 -07:00
steffenhaak 071ebc5f31
fix: keep alive timeout finishes transport instead of connection shutdown (#722)
* fix: keep alive timeout finishes transport instead of shutting down channel

* Update keepalive_test.dart

* Update CHANGELOG.md

---------

Co-authored-by: Moritz <mosum@google.com>
2024-09-06 17:13:11 +02:00
Moritz 81776333d9
Small fixes (#732)
* Small fixes

* Revert changes on file

* Add changelog

* Small fixes in keepalive test

* Add delay

* Fix symbol visibilty

* Add try catch for debugging

* Fail

* fail

* Use for loop
2024-09-06 15:09:54 +02:00
Lasse R.H. Nielsen 38ca626e0a
Use `Map.of` instead of `Map.from` in grpc client. (#724)
* Use `Map.of` instead of `Map.from` in grpc client.

`Map.of` creates a new map with the same keys, values and *type*
as the original map, when used without type arguments or context type,
where `Map.from` creates a `Map<dynamic, dynamic>`.
(This code failed on an attempt to make `Map.unmodifiable` be more
strictly typed, like `Map.of` instead of `Map.from`, showing that
an intermediate map had type `Map<dynamic, dynamic>` unnecessarily).

Same for using `List.of` instead of `List.from`.

The new code should be (microscopically) more efficient and type safe,
and is forwards-compatible with a stronger type on `Map.unmodifiable`.

(The code can be optimized more. For example
`List.of(list1)..addAll(list2)` can be just `list1 + list2` or
`[...list1, ...list2]`, both of which may know the total number
of elements when doing the initial list allocation.
This is a minimal change to allow the type changes for `.unmodifiable`
to get past this very initial blocker in internal tests.)

* Add changelog and minor version increment.

And my save removes trailing spaces.
2024-09-02 16:58:43 +02:00
c-lucera-pvotal 4f6fe9b111
fix: fix headers not completing when call is terminated (#728)
Fixes #727
2024-08-28 08:18:15 +02:00
Galen Warren b999b64502
feat: fix hang that occurs when hot restarting (#718) 2024-07-17 14:11:29 +02:00
Moritz 9f65399e28
Move `codec.dart` to former place (#713) 2024-05-17 14:53:33 +02:00
Moritz 0d02e4386f
Remove dependency on `package:archive` (#707)
* Remove dependency on package:archive

* Test compression on vm only

* Add licenses

* Fix analyze issues

* Fix codec web

* Fix licenses

* Add changelog
2024-05-06 15:25:06 +02:00
Moritz 078fd23bca
Remove generated `StatusCode` (#703)
* Remove generated `StatusCode`

* Rev version for breaking change

* Upgrade min sdk version

* Fix issues
2024-04-25 13:45:40 +02:00
Ruben Garcia bdbe5f5003
Fix issue 669 (#693)
* Fix issue 669

* Update CHANGELOG.md

* Update CHANGELOG.md

* Fix dart format issue.
Fix prefer single quote issue.

* Update pubspec and changelog to avoid merge check
publish / validate
validate packages

* Add test for GRPC Compression Flag

* Fix dart analyze issues.

* Fix latest dart analyze issue (uninizialized variable)
2024-04-22 16:09:18 +02:00
Moritz bb8b6e5950
Make protobuf generated imports absolute (#696)
* Make protobuf generated imports absolute

* Stop test for now
2024-04-19 11:05:59 +02:00
dependabot[bot] b7f9115b98
Bump lints from 2.1.1 to 3.0.0 (#675) 2023-10-23 08:44:11 +00:00
Moritz c1fa94951a
Fix regression on fetching the remote address of a closed socket. (#664)
* Fix regression on fetching the remote address of a closed socket

* Changes as per review

* Add changelog entry

* Rev version for publish
2023-09-08 17:41:32 +02:00
Moritz cba40da0d8
Fix imports in `http2_connection.dart` (#662)
* Fix imports in `http2_connection.dart`

* Export `Proxy`

* dart fix

* Add documentation comment

* Add licenses
2023-08-24 11:50:01 +02:00
Moritz 3f05c37367
Remove canceled streams (#661)
* Remove canceled streams

* Inline variabel

* Add changelog

* Add test

* Add description to test

* More messages for less flakiness
2023-08-24 10:42:21 +02:00
Moritz 4ccd8a0e3d
Add proxy functionality (#657)
* Add proxy to options

* Add proxy connect

* Works now

* Uncomment proxy line

* Revert change

* Doesn't work

* Works

* Fix bug

* Add secure test

* Refine test

* Add changelog

* Changes as per review
2023-08-23 10:07:15 +02:00
Kevin Moore a6322db468
Regenerate protobuf types with new protobuf version (#658) 2023-08-16 05:33:31 -07:00
Moritz 1c18e38252
Forward error (#640)
* Forward error

* Add changelog

* Switch version
2023-07-13 13:30:58 +02:00
Moritz c7e07a09a5
Fix interop tests (#651)
* Fix interop tests

* Keepalive cleanups

* Prepare for publish
2023-07-13 12:05:59 +02:00
Moritz b7df4c8290
Deflake keepalive tests (#645)
* Deflake keepalive tests

* Add timer

* Increase wait timer

* Only send ping on open connection

* Switch server keepalive to fakeasync

* Tiny refactor

* Add changelog entry
2023-06-22 10:30:53 -04:00
Moritz 517cde91a6
Make `GrpcError` non-final to allow implementations. (#647) 2023-06-22 09:20:18 -04:00
Moritz 03f07e9535
Keepalive (#634)
* Keepalive tests run!

* Renaming

* Some refactorings

* Find a place where to handle the keepalive manager

* Fix bug

* Make KeepAliveManager independent of transport

* Fix call sites in client

* Add server keepalive handler

* Wire through onDataReceived

* Add ServerKeepAliveManager test

* Refactorings

* Tests kind of run now

* Add shutdown test

* Remove unneeded override

* Remove unneeded mocks

* Send correct error codes and cleanup

* Small changes

* Rename

* Add documentation

* Add test for !_enforcesMaxBadPings

* Refactor tests

* Switch to http2 master branch

* Renaming

* Null shutdownTimer

* Refactor to event-state model

* Smaller refactorings

* Works now

* Switch tests to isA

* Shifting things around

* Split into server and client

* Format

* rename

* Tweaks

* Switch order of optional parameters to make change non-breaking

* Add some leeway to the durations in tests

* Make keepalive tests vm only

* Switch back to onEvent in state

* Switch to published http2
2023-06-21 11:14:43 -04:00
Moritz aae487d12f
Make constructors of `GrpcError` const (#638)
* Make constructors of `GrpcError` const

* Update CHANGELOG.md

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>

* Update pubspec.yaml

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>

---------

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
2023-06-21 10:48:55 -04:00
Aran Donohue a8cc164cee
Make ResponseStream a regular class (#642) 2023-06-20 04:32:24 -07:00
Kevin Moore d9553ca73f
support latest pkg:protobuf (#641) 2023-06-16 22:47:03 -07:00
Moritz f420b77a22
Switch to Dart 3 (#633)
* Switch to Dart 3

* Trying to get the new version to run

* Fix test

* Switch CI to Dart 3

* Adapt CI

* Do not run vmservice on chrome

* Typo

* Add skip to not fail on `dart test`

* Add changelog entry

* Changes as per review
2023-06-07 10:24:33 +02:00
Nate Bosch 14824dd5d8
Export the Code protobuf (#625) 2023-04-27 10:02:10 +02:00
Nate Bosch 7be6275f03
Check for closed StreamController in more places (#623) 2023-04-21 21:34:00 +02:00
Nate Bosch a1a8e92e38
Add a ChannelShutdownHandler callback (#620)
Add a way to react to the channel shutdown or termination with an
optional callback.

This is not necessarily the API which I would recommend, but this is the
APi that was already inappropriately shipped and in use internally.
2023-04-21 12:01:54 -07:00
Nate Bosch e8893cd08a
Extend StreamView over DelegatingStream (#619)
The `StreamView` class from the SDK provides all the worthwhile behavior
of `DelegatingStream` and the latter may soon be deprecated.
2023-04-19 09:55:56 -07:00
Vyacheslav Egorov 26deabdfd2
Revert "Remove or skip callbacks on old connections" (#593) 2022-12-13 21:40:09 +01:00
Ben Getsug d0e3a4c706
Expose client IP address to server (#590) 2022-12-13 09:12:28 +01:00
Jakob Borg 4dc6e2b252
Remove or skip callbacks on old connections (#522)
Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
Co-authored-by: Vyacheslav Egorov <vegorov@google.com>
Fixes https://github.com/grpc/grpc-dart/issues/521
2022-12-12 10:43:16 +01:00
MattyBoy 60311a7492
Added ability to set connectTimeout of socket (#575) 2022-12-12 09:54:23 +01:00
Ben Getsug 6c0829ed8b
Custom Error Handling for Server (#588)
Closes https://github.com/grpc/grpc-dart/issues/51
2022-12-01 11:29:57 +01:00
Kevin Moore dbf5421eb6
Cleanup: update to and use latest pkg:lints with associated fixes (#587)
Bump min Dart SDK for grpc to 2.17
Regenerate all code
Fix generate scripts
Add dependabot
2022-10-31 11:47:31 -07:00
Vyacheslav Egorov 27a235976a
Change default authority for UDS connections. (#577)
We were using path to the UDS socket itself, which is incorrect `:authority` value. 

This was tripping checks in some HTTP2 protocol implementations.

Instead default `:authority` to `localhost`, which in line with other gRPC implementations.

Fixes #576
2022-09-08 14:41:34 +02:00
Rui Craveiro b8f872a3dc
Send trailers included on GrpcError object (#538) 2022-08-23 12:40:03 +02:00
Cobinja af965f15f7
Expose onConnectionStateChanged for channels (#565)
Co-authored-by: Vyacheslav Egorov <vegorov@google.com>
2022-08-15 15:03:51 +02:00
Vyacheslav Egorov 7cced9282a
Fix compilation with DDC (#516)
b272632450 exposed client certificate through 
`X509Certificate? get clientCertificate;` getter on `ServiceCall` class. This broke 
compilation of `grpc_web` code using DDC, but not dart2js. Turns out that dart2js is 
happy to compile any code using `dart:io` (though the result will not run if you try
to use any of those APIs), but DDC rejects such code eagerly. `package:test` runs 
tests through `dart2js` so DDC breakage was not really caught by CI. 

Unfortunately this discrepancy between DDC and dart2js puts us in some really weird 
spot: most of our tests are platform independent, but most of those tests also 
pull in `dart:io` through transitive dependencies.

This commit is the most minimal change we could make to allow the code compile both 
on the Web and natively. 

A proper fix should be to go through tests one-by-one and make sure that those that
need to run on the Web don't import `dart:io`, but we don't have time to do that 
right now. 

This commit also adds a smoke test to the CI to verify that `grpc_web` example 
builds with DDC.
2021-08-16 14:52:36 +02:00
Kenneth Gulbrandsøy acd2e93a25
Add custom trailers to GrpcError (#493) 2021-08-10 11:53:09 +02:00
Vyacheslav Egorov e9ad5ab16b
Fix CI
* Reformat code with dev build of dartfmt

* Download envoy package manually
2021-08-10 11:04:11 +02:00
Bálint Böde f5508d9801
Fix a typo on the inner invoker parameters (#492) 2021-06-29 23:56:12 +02:00
Tyler Gaw f23070ee85
grpc_or_grpcweb.dart: exporting shared types #486 (#487) 2021-06-13 08:24:28 +02:00