Conversation
WalkthroughThe pull request restructures the Kotlin SDK navigation entry from an external link to an internal documentation hub, then adds eleven comprehensive API reference documentation pages for the Kotlin Chat SDK covering ChatClient, Connection, Rooms, Room, Messages, Message, MessageReactions, RoomReactions, Presence, Occupancy, and Typing interfaces. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
94cd963 to
ea78770
Compare
Add navigation entries for all 11 Kotlin Chat API reference pages, replacing the external Dokka SDK link with inline page links mirroring the JavaScript API reference structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ChatException section, experimental annotations on realtime and stateDispatcher properties, Required column consistency for param tables, and DSL builder overload method signature. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add DSL builder overload method signature for rooms.get() and apply Required column consistency to parameter tables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add experimental channel property, convert property tables to use description-based nullability instead of Required column for interface properties. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add extension function overload signatures for update() and delete(), remove nullable type syntax from parameter tables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Separate with() overloads into distinct signature blocks with code examples, convert property tables to description-based nullability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove nullable type syntax from parameter tables, convert PresenceMember to description-based nullability for interface properties. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove nullable type syntax from parameter tables. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert property tables to description-based nullability for interface properties. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ea78770 to
2cb6203
Compare
GregHolmes
left a comment
There was a problem hiding this comment.
Looks good! Just left a couple comments.
| | --- | --- | --- | | ||
| | rooms | The rooms object, used to get or create chat room instances. | [Rooms](/docs/chat/api/kotlin/rooms) | | ||
| | connection | The connection object, used to monitor the connection status with Ably. | [Connection](/docs/chat/api/kotlin/connection) | | ||
| | clientId | The client ID configured on the underlying Ably Realtime client. Used to identify the current user. May be `null` until authenticated with a token. | String | |
There was a problem hiding this comment.
Should the type be String??
| | typing | Optional | Configuration for typing indicators. | <Table id='TypingOptions'/> | | ||
| | presence | Optional | Configuration for presence events. | <Table id='PresenceOptions'/> | | ||
| | occupancy | Optional | Configuration for occupancy events. | <Table id='OccupancyOptions'/> | | ||
| | messages | Optional | Configuration for message reactions. | <Table id='MessagesOptions'/> | |
There was a problem hiding this comment.
Should this be Configuration for messages?
|
|
||
| | Status | Description | | ||
| | --- | --- | | ||
| | Initialized | A temporary state for when the library is first initialized. | |
There was a problem hiding this comment.
In the JavaScript API pages you have a bit at the end of each description "The value is..."
In the Kotlin ones you haven't included this. Is it intentional?
There was a problem hiding this comment.
I think this can be found in tables in both connection.mdx:28-40 and room.mdx:42-55
|
|
||
| #### Deregister the listener <a id="onStatusChange-unsubscribe"/> | ||
|
|
||
| <MethodSignature>subscription.unsubscribe(): Unit</MethodSignature> |
There was a problem hiding this comment.
Nitpick. Other MethodSignatures use template literal braces, but for all the subscription.unsubscribe() they're bare. For consistency should we update all of these to:
<MethodSignature>{`subscription.unsubscribe(): Unit`}</MethodSignature> ?
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
src/pages/docs/chat/api/kotlin/message-reactions.mdx (1)
15-18: Remove bold prefixes from bullet labels.The strategy bullets use bold prefixes (
**Unique**, etc.). Please switch to plain bullet labels to match style guidance.As per coding guidelines "Avoid em-dashes, Latin abbreviations, slang, and bold prefixes in bullet points".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pages/docs/chat/api/kotlin/message-reactions.mdx` around lines 15 - 18, Update the three bullets in message-reactions.mdx to remove the bold markdown around the strategy names; replace "**Unique**:", "**Distinct**:", and "**Multiple**:" with plain text labels "Unique:", "Distinct:", and "Multiple:" so the bullets read "Unique: One reaction per client...", "Distinct: One reaction of each type...", and "Multiple: Unlimited reactions..."; keep the rest of the sentences unchanged to match the style guideline against bold prefixes.src/pages/docs/chat/api/kotlin/typing.mdx (1)
104-112: Consider documentingTypingSetEventTypevalues.The
typeproperty referencesTypingSetEventTypebut its possible values aren't documented. If this type has specific enum values (similar to howTypingEventTypedocumentsStarted/Stopped), consider adding a hidden table or inline description for completeness.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/pages/docs/chat/api/kotlin/typing.mdx` around lines 104 - 112, The docs reference TypingSetEvent.type (TypingSetEventType) but don't list its possible values; add documentation for TypingSetEventType (either a hidden <Table id='TypingSetEventType'> or an inline description) enumerating each enum member and its meaning (similar to TypingEventType's Started/Stopped example) and update the TypingSetEvent table to link to that TypingSetEventType entry so readers can see the allowed values and semantics.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/pages/docs/chat/api/kotlin/message-reactions.mdx`:
- Around line 75-80: Update the documented exception type for the suspend
functions send(), delete(), and clientReactions() so their "Returns" sections
reference ChatException instead of ErrorInfo (the Kotlin Chat SDK throws
ChatException on suspend failures); locate the three Returns blocks for send(),
delete(), and clientReactions() and replace the ErrorInfo mention with
ChatException, preserving the rest of the sentence. Additionally, remove the
bold prefixes from the bullet list items near the top of the file (the three
bullets that currently start with bold text) to match the writing style
guideline.
In `@src/pages/docs/chat/api/kotlin/occupancy.mdx`:
- Around line 52-57: The docs incorrectly say the suspend function get() throws
ErrorInfo; update the return/throws section for OccupancyData to state that
suspend failures throw ChatException (which wraps ErrorInfo) to match the
ChatClient suspend semantics. Locate the paragraph under "Returns" for
OccupancyData and replace the reference to `ErrorInfo` with `ChatException`,
keeping the note that it wraps `ErrorInfo` for clarity.
In `@src/pages/docs/chat/api/kotlin/presence.mdx`:
- Around line 44-49: Update the documentation return sections in this
presence.mdx file to state that these suspend functions throw ChatException
(which wraps ErrorInfo) instead of ErrorInfo directly; find each occurrence of
`ErrorInfo` in the "Returns" paragraphs for the suspend methods and replace the
text to reference `ChatException` consistent with the ChatClient API docs and
mention that ChatException contains the underlying ErrorInfo details.
In `@src/pages/docs/chat/api/kotlin/room-reactions.mdx`:
- Around line 45-50: Update the documentation for the suspend function send() in
room-reactions.mdx so that the documented thrown type is ChatException instead
of ErrorInfo; replace the reference to [`ErrorInfo`] with [`ChatException`]
(which wraps ErrorInfo) in the "Returns" / error sentence so it matches the
Kotlin Chat SDK convention used in chat-client.mdx.
In `@src/pages/docs/chat/api/kotlin/room.mdx`:
- Around line 70-75: Update the error documentation for the suspend functions
attach() and detach(): replace mentions of throwing [`ErrorInfo`] with
[`ChatException`] and point the link to
/docs/chat/api/kotlin/chat-client#chatexception; specifically edit the
Returns/description text for the attach() and detach() sections so they read
that the suspend function completes when the room is attached/detached or throws
a [`ChatException`] on failure (ChatException wraps ErrorInfo).
---
Nitpick comments:
In `@src/pages/docs/chat/api/kotlin/message-reactions.mdx`:
- Around line 15-18: Update the three bullets in message-reactions.mdx to remove
the bold markdown around the strategy names; replace "**Unique**:",
"**Distinct**:", and "**Multiple**:" with plain text labels "Unique:",
"Distinct:", and "Multiple:" so the bullets read "Unique: One reaction per
client...", "Distinct: One reaction of each type...", and "Multiple: Unlimited
reactions..."; keep the rest of the sentences unchanged to match the style
guideline against bold prefixes.
In `@src/pages/docs/chat/api/kotlin/typing.mdx`:
- Around line 104-112: The docs reference TypingSetEvent.type
(TypingSetEventType) but don't list its possible values; add documentation for
TypingSetEventType (either a hidden <Table id='TypingSetEventType'> or an inline
description) enumerating each enum member and its meaning (similar to
TypingEventType's Started/Stopped example) and update the TypingSetEvent table
to link to that TypingSetEventType entry so readers can see the allowed values
and semantics.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 880a6552-3542-454e-83dd-7dce979f23ec
📒 Files selected for processing (12)
src/data/nav/chat.tssrc/pages/docs/chat/api/kotlin/chat-client.mdxsrc/pages/docs/chat/api/kotlin/connection.mdxsrc/pages/docs/chat/api/kotlin/message-reactions.mdxsrc/pages/docs/chat/api/kotlin/message.mdxsrc/pages/docs/chat/api/kotlin/messages.mdxsrc/pages/docs/chat/api/kotlin/occupancy.mdxsrc/pages/docs/chat/api/kotlin/presence.mdxsrc/pages/docs/chat/api/kotlin/room-reactions.mdxsrc/pages/docs/chat/api/kotlin/room.mdxsrc/pages/docs/chat/api/kotlin/rooms.mdxsrc/pages/docs/chat/api/kotlin/typing.mdx
| ### Returns <a id="send-returns"/> | ||
|
|
||
| `Unit` | ||
|
|
||
| This is a suspend function. It completes when the reaction has been sent, or throws an [`ErrorInfo`](/docs/chat/api/kotlin/chat-client#errorinfo) on failure. | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/message-reactions.mdx | head -85Repository: ably/docs
Length of output: 3944
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/message-reactions.mdx | sed -n '75,80p'Repository: ably/docs
Length of output: 297
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/message-reactions.mdx | sed -n '122,127p'Repository: ably/docs
Length of output: 302
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/message-reactions.mdx | sed -n '326,331p'Repository: ably/docs
Length of output: 335
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/message-reactions.mdx | sed -n '16,18p'Repository: ably/docs
Length of output: 289
🏁 Script executed:
fd 'kotlin.*\.mdx' src/pages/docs/chat/api/ --type fRepository: ably/docs
Length of output: 35
🏁 Script executed:
rg -A5 'suspend function' src/pages/docs/chat/api/kotlin/ --type mdxRepository: ably/docs
Length of output: 80
🏁 Script executed:
rg 'ChatException|ErrorInfo' src/pages/docs/chat/api/kotlin/ --type mdx | head -20Repository: ably/docs
Length of output: 80
🏁 Script executed:
rg 'ChatException|ErrorInfo' src/pages/docs/chat/api/kotlin/ -A2 -B2Repository: ably/docs
Length of output: 18304
🏁 Script executed:
fd . src/pages/docs/chat/api/kotlin/ --type f -name '*.mdx' | xargs grep -l 'throws\|throw'Repository: ably/docs
Length of output: 285
🏁 Script executed:
cat src/pages/docs/chat/api/kotlin/chat-client.mdx | head -200Repository: ably/docs
Length of output: 6893
🏁 Script executed:
rg -A3 'errorinfo|chatexception' src/pages/docs/chat/api/kotlin/ -iRepository: ably/docs
Length of output: 15563
🏁 Script executed:
grep -n 'ErrorInfo\|ChatException' src/pages/docs/chat/api/kotlin/chat-client.mdx | head -30Repository: ably/docs
Length of output: 953
🏁 Script executed:
cat src/pages/docs/chat/api/kotlin/chat-client.mdx | grep -A20 -B5 'errorinfo'Repository: ably/docs
Length of output: 1822
Replace ErrorInfo with ChatException in suspend function error documentation.
The Kotlin Chat SDK throws ChatException on suspend function failure (as documented in chat-client.mdx), not ErrorInfo. Update the Returns sections in send() (line 79), delete() (line 126), and clientReactions() (line 330) to reference ChatException instead.
Also remove bold prefixes from the bullet list at lines 16–18 per the writing style guideline.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/docs/chat/api/kotlin/message-reactions.mdx` around lines 75 - 80,
Update the documented exception type for the suspend functions send(), delete(),
and clientReactions() so their "Returns" sections reference ChatException
instead of ErrorInfo (the Kotlin Chat SDK throws ChatException on suspend
failures); locate the three Returns blocks for send(), delete(), and
clientReactions() and replace the ErrorInfo mention with ChatException,
preserving the rest of the sentence. Additionally, remove the bold prefixes from
the bullet list items near the top of the file (the three bullets that currently
start with bold text) to match the writing style guideline.
| ### Returns <a id="get-returns"/> | ||
|
|
||
| `OccupancyData` | ||
|
|
||
| This is a suspend function. It returns the current occupancy data, or throws an [`ErrorInfo`](/docs/chat/api/kotlin/chat-client#errorinfo) on failure. | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Read the occupancy.mdx file to check the current state at line 52-57
echo "=== occupancy.mdx lines 52-57 ==="
sed -n '52,57p' src/pages/docs/chat/api/kotlin/occupancy.mdx
# Read more context around that area
echo -e "\n=== occupancy.mdx lines 45-65 ==="
sed -n '45,65p' src/pages/docs/chat/api/kotlin/occupancy.mdxRepository: ably/docs
Length of output: 1184
🏁 Script executed:
# Read chat-client.mdx to find documentation about exception handling
echo "=== Searching chat-client.mdx for ChatException and ErrorInfo ==="
grep -n -A3 -B3 "ChatException\|ErrorInfo\|suspend" src/pages/docs/chat/api/kotlin/chat-client.mdx | head -100Repository: ably/docs
Length of output: 1989
🏁 Script executed:
# Check if there are other suspend functions in kotlin docs to see the pattern
echo "=== Looking for other suspend function documentation in kotlin docs ==="
find src/pages/docs/chat/api/kotlin -name "*.mdx" -exec grep -l "suspend function" {} \;Repository: ably/docs
Length of output: 530
🏁 Script executed:
# Check how other suspend functions document exceptions
echo "=== Messages.mdx suspend function exception doc ==="
grep -A2 "suspend function" src/pages/docs/chat/api/kotlin/messages.mdx | head -20
echo -e "\n=== Presence.mdx suspend function exception doc ==="
grep -A2 "suspend function" src/pages/docs/chat/api/kotlin/presence.mdx | head -20
echo -e "\n=== Room.mdx suspend function exception doc ==="
grep -A2 "suspend function" src/pages/docs/chat/api/kotlin/room.mdx | head -20Repository: ably/docs
Length of output: 3059
🏁 Script executed:
# Double-check the exact anchor IDs available in chat-client.mdx
echo "=== All anchor IDs in chat-client.mdx ==="
grep -o 'id="[^"]*"' src/pages/docs/chat/api/kotlin/chat-client.mdx | sort -uRepository: ably/docs
Length of output: 169
Use ChatException (not ErrorInfo) for suspend failure semantics.
At Line 56, get() is documented as throwing ErrorInfo. However, the ChatClient page explicitly states: "All suspend functions in the SDK throw ChatException on failure." The ChatException wraps ErrorInfo and is the correct exception type for suspend APIs. Align this documentation accordingly.
Proposed fix
-This is a suspend function. It returns the current occupancy data, or throws an [`ErrorInfo`](/docs/chat/api/kotlin/chat-client#errorinfo) on failure.
+This is a suspend function. It returns the current occupancy data, or throws a [`ChatException`](/docs/chat/api/kotlin/chat-client#chatexception) on failure.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ### Returns <a id="get-returns"/> | |
| `OccupancyData` | |
| This is a suspend function. It returns the current occupancy data, or throws an [`ErrorInfo`](/docs/chat/api/kotlin/chat-client#errorinfo) on failure. | |
| ### Returns <a id="get-returns"/> | |
| `OccupancyData` | |
| This is a suspend function. It returns the current occupancy data, or throws a [`ChatException`](/docs/chat/api/kotlin/chat-client#chatexception) on failure. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/docs/chat/api/kotlin/occupancy.mdx` around lines 52 - 57, The docs
incorrectly say the suspend function get() throws ErrorInfo; update the
return/throws section for OccupancyData to state that suspend failures throw
ChatException (which wraps ErrorInfo) to match the ChatClient suspend semantics.
Locate the paragraph under "Returns" for OccupancyData and replace the reference
to `ErrorInfo` with `ChatException`, keeping the note that it wraps `ErrorInfo`
for clarity.
| ### Returns <a id="enter-returns"/> | ||
|
|
||
| `Unit` | ||
|
|
||
| This is a suspend function. It completes when the user has successfully entered the presence set, or throws an [`ErrorInfo`](/docs/chat/api/kotlin/chat-client#errorinfo) on failure. | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's look at the presence.mdx file structure and the specific lines mentioned
wc -l src/pages/docs/chat/api/kotlin/presence.mdxRepository: ably/docs
Length of output: 100
🏁 Script executed:
# Read the presence.mdx file with line numbers to see lines around 44-49 and other mentioned lines
cat -n src/pages/docs/chat/api/kotlin/presence.mdx | head -100Repository: ably/docs
Length of output: 3738
🏁 Script executed:
# Let's also check the chat-client.mdx file to understand ChatException and ErrorInfo definitions
cat -n src/pages/docs/chat/api/kotlin/chat-client.mdx | grep -A 5 -B 5 "ChatException\|ErrorInfo" | head -80Repository: ably/docs
Length of output: 2458
🏁 Script executed:
# Let's continue reading the presence.mdx file to see the other lines mentioned (113-118, 151-156, 196-201)
cat -n src/pages/docs/chat/api/kotlin/presence.mdx | sed -n '100,230p'Repository: ably/docs
Length of output: 5105
🏁 Script executed:
# Let's verify the remaining lines mentioned in the review (196-201)
cat -n src/pages/docs/chat/api/kotlin/presence.mdx | sed -n '190,210p'Repository: ably/docs
Length of output: 928
🏁 Script executed:
# Let's also search for any other references to ChatException vs ErrorInfo in the presence.mdx file
grep -n "ChatException\|ErrorInfo" src/pages/docs/chat/api/kotlin/presence.mdxRepository: ably/docs
Length of output: 932
Update suspend function error documentation to reference ChatException instead of ErrorInfo.
Lines 48, 83, 117, 155, and 200 currently state these suspend methods throw ErrorInfo, but the ChatClient API page explicitly documents that "All suspend functions in the SDK throw ChatException on failure." ChatException wraps ErrorInfo as its error details. Update these return sections to reference ChatException for consistency.
Also applies to: 79-84, 113-118, 151-156, 196-201
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/docs/chat/api/kotlin/presence.mdx` around lines 44 - 49, Update the
documentation return sections in this presence.mdx file to state that these
suspend functions throw ChatException (which wraps ErrorInfo) instead of
ErrorInfo directly; find each occurrence of `ErrorInfo` in the "Returns"
paragraphs for the suspend methods and replace the text to reference
`ChatException` consistent with the ChatClient API docs and mention that
ChatException contains the underlying ErrorInfo details.
| ### Returns <a id="send-returns"/> | ||
|
|
||
| `Unit` | ||
|
|
||
| This is a suspend function. It completes when the reaction has been sent, or throws an [`ErrorInfo`](/docs/chat/api/kotlin/chat-client#errorinfo) on failure. | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find src/pages/docs/chat/api/kotlin -type f -name "*.mdx" | head -20Repository: ably/docs
Length of output: 547
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/room-reactions.mdx | sed -n '40,55p'Repository: ably/docs
Length of output: 990
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/chat-client.mdx | head -100Repository: ably/docs
Length of output: 4832
🏁 Script executed:
rg "ErrorInfo|ChatException" src/pages/docs/chat/api/kotlin/chat-client.mdx -A 3 -B 3Repository: ably/docs
Length of output: 1747
🏁 Script executed:
rg "ErrorInfo|ChatException" src/pages/docs/chat/api/kotlin/room-reactions.mdx -A 3 -B 3Repository: ably/docs
Length of output: 272
🏁 Script executed:
grep -n "error" src/pages/docs/chat/api/kotlin/chat-client.mdx | head -20Repository: ably/docs
Length of output: 1504
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/chat-client.mdx | tail -100Repository: ably/docs
Length of output: 3775
Update suspend function error documentation to ChatException.
Line 49 documents the send() suspend function as throwing ErrorInfo. Per the Kotlin Chat SDK documentation in chat-client.mdx, all suspend functions throw ChatException (which wraps ErrorInfo). Update the error type reference from ErrorInfo to ChatException.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/docs/chat/api/kotlin/room-reactions.mdx` around lines 45 - 50,
Update the documentation for the suspend function send() in room-reactions.mdx
so that the documented thrown type is ChatException instead of ErrorInfo;
replace the reference to [`ErrorInfo`] with [`ChatException`] (which wraps
ErrorInfo) in the "Returns" / error sentence so it matches the Kotlin Chat SDK
convention used in chat-client.mdx.
| ### Returns <a id="attach-returns"/> | ||
|
|
||
| `Unit` | ||
|
|
||
| This is a suspend function. It completes when the room is attached, or throws an [`ErrorInfo`](/docs/chat/api/kotlin/chat-client#errorinfo) on failure. | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
fd -t f "room.mdx" -o "chat-client.mdx" src/pages/docs/chat/api/kotlin/Repository: ably/docs
Length of output: 202
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/room.mdx | head -100Repository: ably/docs
Length of output: 5621
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/chat-client.mdx | grep -A 20 -i "errorinfo\|chatexception\|error" | head -60Repository: ably/docs
Length of output: 2823
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/chat-client.mdx | sed -n '119,200p'Repository: ably/docs
Length of output: 2737
🏁 Script executed:
cat -n src/pages/docs/chat/api/kotlin/chat-client.mdx | grep -B 5 -A 15 "ErrorInfo"Repository: ably/docs
Length of output: 2394
Update suspend function error documentation from ErrorInfo to ChatException.
Lines 74 and 94 incorrectly document attach() and detach() as throwing ErrorInfo directly. Per the Kotlin error model in chat-client.mdx, all suspend functions throw ChatException on failure, which wraps ErrorInfo. Update documentation to: "This is a suspend function. It completes when the room is attached/detached, or throws a ChatException on failure."
Also applies to: 90-95
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/pages/docs/chat/api/kotlin/room.mdx` around lines 70 - 75, Update the
error documentation for the suspend functions attach() and detach(): replace
mentions of throwing [`ErrorInfo`] with [`ChatException`] and point the link to
/docs/chat/api/kotlin/chat-client#chatexception; specifically edit the
Returns/description text for the attach() and detach() sections so they read
that the suspend function completes when the room is attached/detached or throws
a [`ChatException`] on failure (ChatException wraps ErrorInfo).
Description
This PR adds a Kotlin Chat API reference into the docs. It follows a similar format to the JavaScript ones, however should be idiomatic where necessary. Uses the Dokka references as source.
Checklist
Summary by CodeRabbit