Closed ttypic closed 1 month ago
The changes introduce a new ChatApi
class designed for interacting with a chat service, featuring methods for retrieving messages, sending messages, and checking occupancy. Additionally, the project enhances its dependency management by incorporating Gson for JSON processing, along with new testing libraries. A new interface for managing paginated results has also been established, improving the overall structure and functionality of the codebase.
File | Change Summary |
---|---|
chat-android/build.gradle.kts |
Changed ably.android dependency from implementation to api and added gson , mockk , and coroutine.test dependencies. |
chat-android/src/main/java/com/ably/chat/ChatApi.kt |
Introduced ChatApi class with methods for message retrieval, sending, and occupancy. |
chat-android/src/main/java/com/ably/chat/PaginatedResult.kt |
Added PaginatedResult interface and extension function for handling paginated results. |
chat-android/src/test/java/com/ably/chat/ChatApiTest.kt |
Introduced unit tests for ChatApi methods. |
gradle/libs.versions.toml |
Introduced Gson, MockK, and Coroutine library dependency versions for JSON handling and testing. |
detekt.yml |
Added excludes property to ignore test directories in complexity checks. |
sequenceDiagram
participant User
participant ChatApi
participant RealtimeClient
participant Server
User->>ChatApi: getMessages(roomId, params)
ChatApi->>RealtimeClient: fetchMessages(roomId, params)
RealtimeClient->>Server: HTTP GET /messages
Server-->>RealtimeClient: return messages
RealtimeClient-->>ChatApi: messages
ChatApi-->>User: return messages
sequenceDiagram
participant User
participant ChatApi
participant RealtimeClient
participant Server
User->>ChatApi: sendMessage(roomId, params)
ChatApi->>RealtimeClient: sendMessage(roomId, params)
RealtimeClient->>Server: HTTP POST /messages
Server-->>RealtimeClient: return response
RealtimeClient-->>ChatApi: response
ChatApi-->>User: return response
Objective | Addressed | Explanation |
---|---|---|
Implement ChatApi (ECO-4962) |
✅ |
🐰 In the meadow, I hop with glee,
NewChatApi
brings joy to me!
Messages sent and received with grace,
With Gson's help, we quicken the pace.
Test cases added, all snug and tight,
Hooray for the code, it feels just right! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Resolves https://github.com/ably-labs/ably-chat-kotlin/issues/8
Created basic ChatApi implementation to perform REST request to the Chat Backend
Summary by CodeRabbit
New Features
ChatApi
class for streamlined interaction with chat services, including message retrieval, sending, and occupancy information.PaginatedResult
interface.Improvements
Bug Fixes
Tests
ChatApi
class to ensure expected behavior.