Skip to content

Failed to Subscribe to Live Query #198

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

Closed
eunomiadev opened this issue Jun 17, 2019 · 11 comments
Closed

Failed to Subscribe to Live Query #198

eunomiadev opened this issue Jun 17, 2019 · 11 comments

Comments

@eunomiadev
Copy link

Invalid argument(s): handleError callback must take either an Object (the error), or both an Object (the error)

Exceptions:

Error subscibe to live query Invalid argument(s): handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace. #0      _BufferingStreamSubscription.onError (dart:async/stream_impl.dart:150:7)
#1      new _BufferingStreamSubscription (dart:async/stream_impl.dart:113:10)
#2      new _ForwardingStreamSubscription (dart:async/stream_pipe.dart:121:9)
#3      _ForwardingStream._createSubscription (dart:async/stream_pipe.dart:91:16)
#4      _ForwardingStream.listen (dart:async/stream_pipe.dart:86:12)
#5      LiveQuery.subscribe (package:parse_server_sdk/src/network/parse_live_query.dart:78:23)
<asynchronous suspension>

Code:

    var live = LiveQuery();
    final query = QueryBuilder<ParseObject>(ParseObject('Coins'));
    live.subscribe(query).catchError(
        (e, trace) => print('Error subscibe to live query $e $trace'));

SDK Version:
version: 1.0.22

@tran-huy-phuc
Copy link

@eunomiadev I am getting same error. Did you fix it yet?

@douglasmuraoka
Copy link
Contributor

@phillwiggins I have faced this problem when testing the sessionToken: null problem (#196).
I changed this onError handler to receive Object instead of Error and looks like it solved the problem, but I don't know if that's a Dart good practice.

Could you please check it? If this solution works for you, I can create a PR for it.

@mdc555
Copy link

mdc555 commented Aug 23, 2019

I'm also having issues when trying to subscribe to LiveQueries.
Getting this error:
Invalid argument(s): handleError callback must take either an Object (the error), or both an Object (the error) and a StackTrace. E/flutter ( 8401): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Failed assertion: boolean expression must not be null E/flutter ( 8401): #0 Future._propagateToListeners.handleError (dart:async/future_impl.dart:649:26) E/flutter ( 8401): #1 Future._propagateToListeners (dart:async/future_impl.dart:672:24) E/flutter ( 8401): #2 Future._completeError (dart:async/future_impl.dart:491:5) E/flutter ( 8401): #3 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12) E/flutter ( 8401): #4 _Completer.completeError (dart:async/future_impl.dart:27:5) E/flutter ( 8401): #5 _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:40:18) E/flutter ( 8401): #6 LiveQuery.subscribe (package:parse_server_sdk/src/network/parse_live_query.dart) E/flutter ( 8401): <asynchronous suspension> E/flutter ( 8401): #7 _MyHomePageState.build.<anonymous closure> (package:parse1/main.dart:172:24) E/flutter ( 8401): #8 _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6) E/flutter ( 8401): #9 _MyHomePageState.build.<anonymous closure> (package:parse1/main.dart:149:26) E/flutter ( 8401): #10 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14) E/flutter ( 8401): #11 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:566:30) E/flutter ( 8401): #12 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24) E/flutter ( 8401): #13 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9) E/flutter ( 8401): #14 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:177:9) E/flutter ( 8401): #15 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:436:9) E/flutter ( 8401): #16 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12) E/flutter ( 8401): #17 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11) E/flutter ( 8401): #18 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:221:19) E/flutter ( 8401): #19 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22) E/flutter ( 8401): #20 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) E/flutter ( 8401): #21 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) E/flutter ( 8401): #22 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) E/flutter ( 8401): #23 _rootRunUnary (dart:async/zone.dart:1136:13) E/flutter ( 8401): #24 _CustomZone.runUnary (dart:async/zone.dart:1029:19) E/flutter ( 8401): #25 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7) E/flutter ( 8401): #26 _invoke1 (dart:ui/hooks.dart:233:10) E/flutter ( 8401): #27 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)
How to solve this??

@arvanus
Copy link

arvanus commented Aug 23, 2019

Same here

Parse server version: 1.0.22

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.9.1-pre.98, on Microsoft Windows [versão 10.0.18362.295], locale pt-BR)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.3)
[√] VS Code (version 1.37.1)
[√] VS Code, 64-bit edition (version 1.26.1)
[√] Connected device (1 available)

@arvanus
Copy link

arvanus commented Aug 23, 2019

Found probable fix, (I won't make a pull request now, because I can't test right now)
edit file parse_live_query.dart
line 104
change
}, onError: (Error error) {

to:
}, onError: (error) {

@mdc555
Copy link

mdc555 commented Aug 23, 2019

Yeah... I've done the same but changed to:
onError: (Object error)
and it finally worked....

@phillwiggins
Copy link
Member

phillwiggins commented Aug 23, 2019 via email

@mdc555
Copy link

mdc555 commented Aug 23, 2019

@phillwiggins A necessary fix for this package. Love it!! 😉😉

@arvanus
Copy link

arvanus commented Aug 23, 2019

That worked? I'm so glad to help :)

@phillwiggins
Copy link
Member

So it looks like this was already fixed on branch 'release/1.0.23'.

This will be released shortly.

@phillwiggins
Copy link
Member

There's not been much movement on this recently. Are we safe to close?

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

No branches or pull requests

6 participants