nakama-dart icon indicating copy to clipboard operation
nakama-dart copied to clipboard

Add rpc in Client

Open aminalaee opened this issue 3 years ago • 11 comments

I think this should replace #32 as there are a few improvements on the RPC call.

Please review this after #34

aminalaee avatar Jun 23 '22 18:06 aminalaee

@obrunsmann This is ready for review.

aminalaee avatar Jul 06 '22 08:07 aminalaee

This branch was based on listLeaderboard which is not merged into develop.

aminalaee avatar Jul 07 '22 12:07 aminalaee

@aminalaee fully merged! Ready to review after the conflicts 😏

obrunsmann avatar Jul 07 '22 13:07 obrunsmann

Thank you @obrunsmann for the review and the work. Resolved the conflicts.

aminalaee avatar Jul 07 '22 13:07 aminalaee

@obrunsmann Please review.

aminalaee avatar Jul 07 '22 13:07 aminalaee

@obrunsmann I think this one is independent from the rest.

aminalaee avatar Jul 19 '22 11:07 aminalaee

@aminalaee all righty 😎 I am ready for all the reviews this week! Pls give me just another 1 or 2 days ❤️

obrunsmann avatar Jul 19 '22 11:07 obrunsmann

No worries, thank you for the effort 🚀

aminalaee avatar Jul 19 '22 11:07 aminalaee

Hello guys, I tried this PR on my project because I needed to get response from rpc. It works on my iOS Simulator but fails on web. Below is the log I got.

I hope this helps!

rpc error Unexpected null value., dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49      throw_
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 528:63  nullCheck
packages/nakama/src/nakama_client/nakama_api_client.dart 472:49                   <fn>
packages/nakama/src/nakama_client/nakama_api_client.dart 472:42                   rpc
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 45:50                <fn>
dart-sdk/lib/async/zone.dart 1434:47                                              _rootRunUnary
dart-sdk/lib/async/zone.dart 1335:19                                              runUnary
dart-sdk/lib/async/future_impl.dart 147:18                                        handleValue
dart-sdk/lib/async/future_impl.dart 766:44                                        handleValueCallback
dart-sdk/lib/async/future_impl.dart 795:13                                        _propagateToListeners
dart-sdk/lib/async/future_impl.dart 566:5                                         [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 639:7                                         <fn>
dart-sdk/lib/async/zone.dart 1426:13                                              _rootRun
dart-sdk/lib/async/zone.dart 1328:19                                              run
dart-sdk/lib/async/zone.dart 1236:7                                               runGuarded
dart-sdk/lib/async/zone.dart 1276:23                                              callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                                  _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                                   _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 166:15               <fn>

ahndwon avatar Jul 28 '22 10:07 ahndwon

@ahndwon Thanks for the feedback, is this the full trace? As far as I can see this is happening on the Rpc()..mergeFromProto3Json(res.body!.toJson()); part, right?

aminalaee avatar Jul 28 '22 10:07 aminalaee

@aminalaee Yes this is the full trace. I'm new to Flutter Web and it seems web does not show the full trace simply as Flutter Android, iOS. And yes it's happening on Rpc()..mergeFromProto3Json(res.body!.toJson());. body is null

ahndwon avatar Jul 28 '22 10:07 ahndwon