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

[leak]debounce.dart #15

Closed
Abacaxi-Nelson opened this issue Mar 2, 2021 · 4 comments
Closed

[leak]debounce.dart #15

Abacaxi-Nelson opened this issue Mar 2, 2021 · 4 comments

Comments

@Abacaxi-Nelson
Copy link

Hi @imtoori
Each time i send a message, i get following error:

[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: NoSuchMethodError: The method 'call' was called on null.
Receiver: null
Tried calling: call(Instance of 'ChannelState')
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      Function._apply (dart:core-patch/function_patch.dart:11:30)
#2      Function.apply (dart:core-patch/function_patch.dart:34:12)
#3      debounce.<anonymous closure>
package:stream_chat/src/debounce.dart:21
#4      _rootRun (dart:async/zone.dart:1182:47)
#5      _CustomZone.run (dart:async/zone.dart:1093:19)
#6      _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#7      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#8      _rootRun (dart:async/zone.dart:1190:13)
#9      _CustomZone.run (dart:async/zone.dart:1093:19)
#10     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1021:23)
#11     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#12     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:397:19)
#13     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:428:5)
#14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
final timer = Timer(timeout, () {
    print('debounce target $target positionalArguments $positionalArguments namedArguments $namedArguments');
    Function.apply(
      target,
      positionalArguments,
      namedArguments,
    );
  });

result of the print:

flutter: debounce target null positionalArguments [Instance of 'ChannelState'] namedArguments null

I dont understand the purpose of this class, but maybe testing null value before calling `Function.apply``

Im on last version :)

@Abacaxi-Nelson Abacaxi-Nelson changed the title [leak] [leak]debounce.dart Mar 2, 2021
@imtoori
Copy link
Contributor

imtoori commented Mar 2, 2021

Thanks for reporting the issue!

I'll check it tomorrow morning and let you know
Btw we use that function to make sure to not call a certain method excessively
For example for database calls or similar

@imtoori
Copy link
Contributor

imtoori commented Mar 3, 2021

are you sure you're on the latest version?

1.3.2-beta?

@Abacaxi-Nelson
Copy link
Author

Hi @imtoori
Let me retest, and double check my version installed :)

@Abacaxi-Nelson
Copy link
Author

you were right, its gone !
Thank you,

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

2 participants