Skip to content
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

Unsubscribe channel throws exception #58

Open
mehtahardikr opened this issue Jul 13, 2021 · 3 comments
Open

Unsubscribe channel throws exception #58

mehtahardikr opened this issue Jul 13, 2021 · 3 comments
Assignees
Labels
status: in triage This issue is being triaged. status: waiting This issue waits for feedback from author. type: bug This issue reports a bug.

Comments

@mehtahardikr
Copy link

sample code to replicate:

var keySet = Keyset(
      subscribeKey: 'demo',
      publishKey: 'demo', uuid: UUID('demo')
    );

var _pubnub = PubNub(networking: NetworkingModule(retryPolicy: RetryPolicy.exponential(maxRetries: 10)), defaultKeyset: keySet);

 var  _subscription = await _pubnub.subscribe(channels: {'channelA'}, withPresence: true);

_subscription?.messages?.listen((envelope) {
        debugPrint('${envelope.payload}');
  
      });


_subscription?.dispose();
Unhandled Exception: NoSuchMethodError: The method 'cancel' was called on null.
E/flutter (18363): Receiver: null
E/flutter (18363): Tried calling: cancel()
E/flutter (18363): #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
E/flutter (18363): #1      Subscription.cancel (package:pubnub/src/subscribe/subscription.dart:164:33)
E/flutter (18363): #2      Subscription.dispose (package:pubnub/src/subscribe/subscription.dart:173:29)
E/flutter (18363): #3      PubnubService.destroyPubNub (package:gr8_tables_flutter/PubnubConfig/pubnub_service.dart:151:53)
E/flutter (18363): #4      BottomSheetUtils.bottomSheetCategoryClick (package:gr8_tables_flutter/Utils/bottom_sheet_utils.dart:415:32)
E/flutter (18363): #5      BottomSheetUtils.showBottomSheet.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:gr8_tables_flutter/Utils/bottom_sheet_utils.dart:101:64)
E/flutter (18363): #6      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:991:20)
E/flutter (18363): #7      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (18363): #8      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:607:11)
E/flutter (18363): #9      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:296:5)
E/flutter (18363): #10     BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:267:7)
E/flutter (18363): #11     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:157:27)
E/flutter (18363): #12     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:385:20)
E/flutter (18363): #13     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:361:22)
E/flutter (18363): #14     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:278:11)
E/flutter (18363): #15     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:316:7)
E/flutter (18363): #16     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:280:5)
E/flutter (18363): #17     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:238:7)
E/flutter (18363): #18     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:221:7)
E/flutter (18363): #19     _rootRunUnary (dart:async/zone.dart:1370:13)
E/flutter (18363): #20     _CustomZone.runUnary (dart:async/zone.dart:1265:19)
E/flutter (18363): #21     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
E/flutter (18363): #22     _invoke1 (dart:ui/hooks.dart:180:10)
E/flutter (18363): #23     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:276:7)
E/flutter (18363): #24     _dispatchPointerDataPacket (dart:ui/hooks.dart:96:31)
@are
Copy link
Contributor

are commented Jul 14, 2021

Hello, can you let me know what version of the PubNub Dart SDK are you using?

@are are self-assigned this Jul 14, 2021
@are are added status: in triage This issue is being triaged. type: bug This issue reports a bug. status: waiting This issue waits for feedback from author. labels Jul 14, 2021
@mehtahardikr
Copy link
Author

@are : its ^3.2.0

@davidbrenner
Copy link

Hey, @are - I am getting an exception from the cancel completer using pubnub 4.2.2. (so, a different issue than the original issue, but same general idea). This seems to be locking up my app. If it's helpful, I can create a separate ticket for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in triage This issue is being triaged. status: waiting This issue waits for feedback from author. type: bug This issue reports a bug.
Projects
None yet
Development

No branches or pull requests

3 participants