Skip to content

fix onListen for 0 queued isolates #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2021

Conversation

joachimvalente
Copy link
Contributor

Fix onListen when there are no queued isolates. This can happen for example when hot-reloading.

Fix `onListen` when there are no queued isolates. This can happen for example when hot-reloading.
@joachimvalente joachimvalente changed the title [android] fix onListen for 0 queued isolates fix onListen for 0 queued isolates May 30, 2021
@guymclean
Copy link

guymclean commented Jun 21, 2021

@joachimvalente is this a fix the same issue that I am getting when I hot reload?

E/EventChannel#com.rmawatson.flutterisolate/event(13321): Failed to open event stream E/EventChannel#com.rmawatson.flutterisolate/event(13321): java.util.NoSuchElementException E/EventChannel#com.rmawatson.flutterisolate/event(13321): at java.util.LinkedList.removeFirst(LinkedList.java:270) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at java.util.LinkedList.remove(LinkedList.java:685) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at com.rmawatson.flutterisolate.FlutterIsolatePlugin.onListen(FlutterIsolatePlugin.java:174) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:188) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at android.os.MessageQueue.nativePollOnce(Native Method) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at android.os.MessageQueue.next(MessageQueue.java:335) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at android.os.Looper.loop(Looper.java:183) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at android.app.ActivityThread.main(ActivityThread.java:7664) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at java.lang.reflect.Method.invoke(Native Method) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/EventChannel#com.rmawatson.flutterisolate/event(13321): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

======== Exception caught by services library ====================================================== The following PlatformException was thrown while activating platform stream on channel com.rmawatson.flutterisolate/event: PlatformException(error, null, null, null) When the exception was thrown, this was the stack: #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:597:7) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18) <asynchronous suspension> #2 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:545:9) <asynchronous suspension>

@ened
Copy link
Contributor

ened commented Jun 21, 2021

@rmawatson how are you? Could you please review this PR?

@rmawatson
Copy link
Owner

@rmawatson how are you? Could you please review this PR?

Hi @ened you're best to ask @nmfisher as he maintains this project.

@nmfisher
Copy link
Collaborator

Hi all - I am aware of this, just very busy at the moment. I'll try and merge this weekend.

@ened
Copy link
Contributor

ened commented Jun 21, 2021

@nmfisher fantastic!

For anyone waiting on this PR (@guymclean), you can modify your pubspec.yaml like this to test the changes:

dependency_overrides:
  flutter_isolate:
    git:
      url: https://github.com/joachimvalente/flutter_isolate
      ref: a4c84d020de40f31ff7c30965e8fe252b6e3aa9e # patch-1, see https://github.com/rmawatson/flutter_isolate/pull/78

@guymclean
Copy link

Nice one, thanks guys!

@nmfisher nmfisher merged commit 37adcf8 into rmawatson:master Jun 28, 2021
@nmfisher
Copy link
Collaborator

Thanks @joachimvalente

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants