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

Error "object is unsendable" when using TalkDioLogger inside isolate #219

Open
berbsd opened this issue Apr 11, 2024 · 0 comments
Open

Error "object is unsendable" when using TalkDioLogger inside isolate #219

berbsd opened this issue Apr 11, 2024 · 0 comments

Comments

@berbsd
Copy link

berbsd commented Apr 11, 2024

I am curious if anyone has seen this problem before. I don't have a small code sample to repro at this time, but can put one together if really needed.

I am using a shared instance of Dio between my main thread and different isolates. It works well, unless I use the TalkerDioLogger with the main talker instance declared in my main function. In this case, the error below happens constantly. If I remove talker, then everything works flawlessly. It is 100% repeatable for me (and annoying).

I tried different ways to implement my isolates but to no avail. if I add interceptor to the shared client within the isolate with a separate instance of talker, then no issues, but logs are not visible at all.

Any pointers would be greatly appreciated.

Thx

David

     │ [error] | 0:18:26 673ms | Invalid argument(s): Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _AsyncCompleter@4048458 (see restrictions listed at `SendPort.send()` documentation for more information)
     │  <- controller in Instance of 'MapUpdated' (from package:mobile_app/views/charger_search/bloc/charger_search_bloc.dart)
     │  <- Instance of 'Transition<ChargerSearchEvent, ChargerSearchState>' (from package:bloc/src/transition.dart)
     │  <- Instance of 'BlocStateLog' (from package:talker_bloc_logger/bloc_logs.dart)
     │  <- _List len:63 (from dart:core)
     │  <- Instance(length:44) of '_GrowableList' (from dart:core)
     │  <- _history in Instance of 'DefaultTalkerHistory' (from package:talker/src/history.dart)
     │  <- _history in Instance of 'Talker' (from package:talker/src/talker.dart)
     │  <- _talker in Instance of 'TalkerDioLogger' (from package:talker_dio_logger/talker_dio_logger_interceptor.dart)
     │  <- _List len:3 (from dart:core)
     │  <- Instance(length:3) of '_GrowableList' (from dart:core)
     │  <- Instance of 'Interceptors' (from package:dio/src/dio_mixin.dart)
     │  <- Instance of 'DioForNative' (from package:dio/src/dio/dio_for_native.dart)
     │  <- Record (0, Instance of 'DioForNative', Instance(length:1) of '_GrowableList', Instance of 'RootIsolateToken') (from dart:core)
     │ 
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

1 participant