Closed rvowles closed 3 years ago
Sorry about the reformatting, thats dartfmt.
It's been a while since I did any Dart development.
I'm trying to run the tests for this package and I'm getting this error:
$ pub run test
Precompiling executable... (5.6s)
Failed to precompile test:test:
../../../.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.0.5/lib/src/multi_headers.dart:78:8: Error: The method 'MultiHeaders.add' has fewer named arguments than those of overridden method 'HttpHeaders.add'.
void add(String name, Object value) {
^
org-dartlang-sdk:///sdk/lib/_http/http.dart:694:8: Context: This is the overridden method ('add').
void add(String name, Object value,
^
../../../.pub-cache/hosted/pub.dartlang.org/http_multi_server-2.0.5/lib/src/multi_headers.dart:105:8: Error: The method 'MultiHeaders.set' has fewer named arguments than those of overridden method 'HttpHeaders.set'.
void set(String name, Object value) {
^
org-dartlang-sdk:///sdk/lib/_http/http.dart:703:8: Context: This is the overridden method ('set').
void set(String name, Object value,
^
Any chance this is due to your change or any chance you could help resolve this error?
Sure!
hrm:
dart-eventsource git:(feature/close-on-last-stream) ✗ pub get
Resolving dependencies...
Got dependencies!
➜ dart-eventsource git:(feature/close-on-last-stream) ✗ pub run test
Precompiling executable... (10.0s)
Precompiled test:test.
00:01 +3: All tests passed!
@rvowles why did you close this?
I was not planning on resolving any of the issues raised, so rather than wasting your & others time, I closed & dropped it. It is only polite!
Hey @rvowles, I still don't understand why you deleted your branch if the work was almost done, this job was useful for us!
Thanks anyway!
@selankon its a simple set of changes, you can reapply them and resubmit yourself?
Yes for sure (:
git checkout -b close-on-last-stream
git pull origin 825cc2d572253a03b66cb5996232ec8e564747bc
Thanks!
Anyway this code is not working at all.
If I do this:
StreamSubscription<Event> streamSubscription;
var eventSource =
await EventSource.connect(reqUrl,
method: "POST",
body: jsonEncode(body),
headers: {
HttpHeaders.authorizationHeader:
basicAuth
},
closeOnLastListener: true,
);
streamSubscription = eventSource.listen((Event event) {
// Deserialize the message
streamSubscription.cancel();
});
The second time I execute this code I get the error NoSuchMethodError: The method 'add' was called on null.
here.
Not sure why, because I'm instantiating the eventSource
each time, is strange :thinking:
You cannot use POST, only GET.
Do you think this cause the error? Our server only listen POST calls for some non relevant reason
This error happen even using GET