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

Realtime Chat #13

Closed
Allan-Nava opened this issue Jun 7, 2021 · 16 comments
Closed

Realtime Chat #13

Allan-Nava opened this issue Jun 7, 2021 · 16 comments
Assignees
Milestone

Comments

@Allan-Nava
Copy link

Also the chat system?

Originally posted by @Allan-Nava in #8 (comment)

@obrunsmann obrunsmann added this to the v1.0.0 milestone Jun 7, 2021
@obrunsmann obrunsmann changed the title Also the chat system? Realtime Chat Jun 8, 2021
@obrunsmann obrunsmann self-assigned this Jun 8, 2021
@obrunsmann
Copy link
Contributor

Yeah, needs to be done as well. Updated the title.

@Allan-Nava
Copy link
Author

Allan-Nava commented Jun 8, 2021

You are right !!

@AxiatCode
Copy link

Any ETA on this will be helpful thanks.

@duck-dev-go
Copy link

+1

@fbernaly
Copy link
Contributor

@obrunsmann : are you open to contributions? I need to work on some POC for my company that requires the chat feature. Let me know if I can send my PRs and contribute in this plugin.

@obrunsmann
Copy link
Contributor

@fbernaly Yes of course! Highly appreciated! I am currently limited in time for this project, but I think my next feature might be the storage one. So would be a good addition if you could contribute with the chat 💪

The only important thing for me is that we find the perfect way of using a similar API like the official SDK but still in Dart's way with using the special features here.

@fbernaly
Copy link
Contributor

@obrunsmann: sure, i will try to follow the same API they have in the official SDK.

@fbernaly
Copy link
Contributor

@obrunsmann: a couple of questions?

  1. where did you get this file from? https://github.com/obrunsmann/flutter_nakama/blob/main/lib/src/rest/apigrpc.swagger
    is it from here? https://github.com/heroiclabs/nakama/blob/master/apigrpc/apigrpc.swagger.json
    I think the one from heroiclabs has some new lines. Should we update it?

  2. how do you generate the swagger.dart files? I saw that you have swagger_dart_code_generator and went to the documentation of that plugin and tried to run flutter pub run build_runner build but getting this error:

% flutter pub run build_runner build                             
[INFO] Generating build script...
[INFO] Generating build script completed, took 560ms

[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script......
[INFO] Precompiling build script... completed, took 1.0s



You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues


FileSystemException: Directory listing failed, path = 'lib/rest/' (OS Error: No such file or directory, errno = 2)
dart:io                                                                     _Directory.listSync
package:swagger_dart_code_generator/swagger_dart_code_generator.dart 20:52  _generateExtensions
package:swagger_dart_code_generator/swagger_dart_code_generator.dart 50:32  SwaggerDartCodeGenerator.buildExtensions
package:build_runner_core/src/package_graph/apply_builders.dart 399:33      _validateBuilder
package:build_runner_core/src/package_graph/apply_builders.dart 181:9       new BuilderApplication.forBuilder.<fn>.<fn>
package:build_runner_core/src/package_graph/apply_builders.dart 342:27      _createBuildPhasesForBuilderInCycle.<fn>.<fn>
dart:core                                                                   Iterable.toList
package:build_runner_core/src/package_graph/apply_builders.dart 289:8       createBuildPhases
package:build_runner_core/src/generate/build_impl.dart 110:29               BuildImpl.create
package:build_runner_core/src/generate/build_runner.dart 34:42              BuildRunner.create
package:build_runner/src/generate/build.dart 109:35                         build
package:build_runner/src/entrypoint/build.dart 35:18                        BuildCommand._run
package:args/command_runner.dart 209:13                                     CommandRunner.runCommand
package:build_runner/src/entrypoint/run.dart 26:18                          run
.dart_tool/build/entrypoint/build.dart 31:16                                main

pub finished with exit code 1
  1. is there a faster way to get in contact with you?

@obrunsmann
Copy link
Contributor

@fbernaly Sure, always welcome! :)

  1. Correct, it's from nakama's package.

  2. You're right, I missed updating the path when I moved some files months ago. This is the respective fix: 8329b79
    But there are a couple of new problems here, so I'll open a new issue. See Upgrading swagger & chopper client #27

@fbernaly
Copy link
Contributor

@obrunsmann : I have completed the Chat API. I followed this documentation:
https://heroiclabs.com/docs/nakama/client-libraries/unity/#chat
and created these methods:

  • joinChat
  • sendMessage
  • listMessages
  • updateMessage

and added a StreamController to listen to incoming messages just as you are doing for other streams. I tried to follow the same style you already have in place.

So far, it is working with my Nakama server. I am just waiting for #26 to be merged to create send you the PR with the new functionality.

@Allan-Nava
Copy link
Author

@obrunsmann : I have completed the Chat API. I followed this documentation: https://heroiclabs.com/docs/nakama/client-libraries/unity/#chat and created these methods:

  • joinChat
  • sendMessage
  • listMessages
  • updateMessage

and added a StreamController to listen to incoming messages just as you are doing for other streams. I tried to follow the same style you already have in place.

So far, it is working with my Nakama server. I am just waiting for #26 to be merged to create send you the PR with the new functionality.

Good !

@fbernaly
Copy link
Contributor

fbernaly commented Apr 1, 2022

Here is the PR: #28

@obrunsmann
Copy link
Contributor

obrunsmann commented Apr 28, 2022

#28 is merged into this repo but still needs some improvements. I am working on it an expect to publish on pub.dev before end of week. Changes are locally available in feature/chat

@fbernaly
Copy link
Contributor

thanks @obrunsmann

@fbernaly
Copy link
Contributor

@obrunsmann : are you going to take care of those improvements or should I send another PR with all your suggestions?

@obrunsmann
Copy link
Contributor

obrunsmann commented May 24, 2022

Hey guys, was quite a bit of work until now. @fbernaly please take a look at the test cases. For me it's very important that the cases are not just small unit tests checking that a result of sending a message is null or does not throw an exception but more that the SDK is really able to receive a message on the other side.

The feature is not yet ready because some tests are failing for me, I am checking currently together with Nakama team to get direct feature running.

So your feedback on chat feature is highly appreciated, if you have some time you all can use the published pre release. I am going to update that one until chat is stable and fully test covered.

Todos:

  • Working tests for direct messages
  • Working tests for group messages
  • Tests for message history
  • Tests for leaving chat
  • Tests for listing online users
  • Tests for chat/channel presence

Pre-Release
I just published a pre release which you can use right from pub.dev (0.15-dev.x)

Contribution
If somebody could take care of one of the todos above, just send a PR.

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

5 participants