-
Notifications
You must be signed in to change notification settings - Fork 23
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
[WIP] Move to OkHttp and add REST calls #26
Conversation
…f we need), tests with mockwebserver
Hey I'm not quite sure, how reliable OkHTTP websockets are. As far as REST is concerned, there are other libraries available which provides pure REST API's. I tested OkHTTP websockets and it gives problem for maintaining connection with server. For now lets do one thing, keep both libraries separate and test them on various platforms. I will create a separate release for SDK based on OkHTTP for native app, keep your branch sync with develop branch. |
I will test the current implementation for 2-3 days. I will see if it works great on various devices 👍 . Then I can merge it with develop. Till then try pushing your updates to OkHTTP branch. |
This is still a working in progress, far from merge state yet. |
@luciofm still great work 👍 |
Please do not change lots of method names. Users will need to alter their code if new artifact is published with changed method names. Try to update docs in sync with updated names. |
- Check callback matches CallbackType on createCallback()
@sacOO7 now is the time to break things... once we got a stable API and release 1.0, then we cannot break compatibility with previous versions... |
ohk, I think I need to test the API on your branch fully. Lot of code has been changed from last time. |
Hey please do not remove APIs for realtime, lets make them deprecated. Let's add a builder class for RocketChatAPI which can build both REST and realtime client (same as OkHTTP). I think it's better to separate both from each other. It's easy to manage that way and makes code more modular. I truly believe it is a better approach. |
Give it a new name like RocketChatRestClient. All rest APIs can reside in there. Maybe you can rename RocketChatAPI to RocketChatRealtimeClient (two different classes). That way code is more easy to handle and understand 👍 . Great work 💯 |
Hey @luciofm please add your suggestions here |
Hey any thought on above suggestions? Please let me know about it. We can have a discussion on this. |
…zation. Rename some DTOs to remove the "Object" suffix.
- Rename LiveChatAPI to LiveChatClient - Revert Callbacks to interfaces - Rename some LiveChat listeners do Callbacks - Moved some classes to an internal package - removed old LiveChat tests - need to reimplement them based on WebsocketImplTest
Re-enable livechat module:
Separate the implementation of REST api and Websocket Realtime API.
I will add here points that will cover tasks that need to be covered before PR is merged. |
I will add some code for LiveChat SDK that will cover changes to subscriptions middleware similar to core middleware. |
TODO
|
Merging to development. Still lots of stuff to break before 1.0 |
Work in Progress
Moving the SDK to OkHttp. Since we are going to use OkHttp for the REST calls, and we will use it on the App, doesn't make sense to have 2 websocket stacks consuming resources (size and methods).
Adding REST calls for various calls. On the new App, we will start to use REST calls on many methods, including login, list channels, list channel members, send messages, pin/unpin messages, star/unstar messages and more.
Use mockwebserver (from OkHttp) for testing the SDK