Skip to content

[DX-630] Add Kotlin Chat API references#3241

Open
m-hulbert wants to merge 12 commits intomainfrom
dx-630-kotlin-chat-api
Open

[DX-630] Add Kotlin Chat API references#3241
m-hulbert wants to merge 12 commits intomainfrom
dx-630-kotlin-chat-api

Conversation

@m-hulbert
Copy link
Contributor

@m-hulbert m-hulbert commented Mar 4, 2026

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

  • Documentation
    • Added comprehensive Kotlin SDK API reference documentation covering ChatClient configuration, Connection management, Room operations, Messages, Presence, Typing indicators, Message and Room Reactions, and Occupancy. Updated navigation to provide structured access to individual API guides.

@m-hulbert m-hulbert requested a review from sacOO7 March 4, 2026 09:22
@m-hulbert m-hulbert self-assigned this Mar 4, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 4, 2026

Walkthrough

The 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

Cohort / File(s) Summary
Navigation Structure
src/data/nav/chat.ts
Replaces single external Kotlin SDK link with nested internal documentation structure containing multiple API reference pages (ChatClient, Connection, Rooms, Room, Messages, Message, MessageReactions, Presence, Occupancy, Typing, RoomReactions).
Kotlin API Documentation
src/pages/docs/chat/api/kotlin/chat-client.mdx, connection.mdx, messages.mdx, message.mdx, message-reactions.mdx, room-reactions.mdx, room.mdx, rooms.mdx, presence.mdx, occupancy.mdx, typing.mdx
Comprehensive API reference pages documenting Kotlin SDK interfaces, methods, properties, data structures, parameters, return types, error handling, usage examples, and both listener-based and Flow-based consumption patterns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 In the warren of docs, a structure takes flight,
Kotlin's APIs now organized just right,
ChatClient to Typing, each page shines anew,
Navigation flows smoothly through Ably's chat view,
Hops gleefully with reference complete! 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding Kotlin Chat API references to the documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dx-630-kotlin-chat-api

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@GregHolmes GregHolmes force-pushed the dx-630-kotlin-chat-api branch from 94cd963 to ea78770 Compare March 4, 2026 10:39
m-hulbert and others added 12 commits March 4, 2026 16:01
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>
@GregHolmes GregHolmes force-pushed the dx-630-kotlin-chat-api branch from ea78770 to 2cb6203 Compare March 4, 2026 16:01
Copy link
Contributor

@GregHolmes GregHolmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'/> |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be Configuration for messages?


| Status | Description |
| --- | --- |
| Initialized | A temporary state for when the library is first initialized. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> ?

@sacOO7 sacOO7 requested a review from ttypic March 5, 2026 16:59
@sacOO7
Copy link
Contributor

sacOO7 commented Mar 5, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 documenting TypingSetEventType values.

The type property references TypingSetEventType but its possible values aren't documented. If this type has specific enum values (similar to how TypingEventType documents Started/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

📥 Commits

Reviewing files that changed from the base of the PR and between d41d6e4 and 2cb6203.

📒 Files selected for processing (12)
  • src/data/nav/chat.ts
  • src/pages/docs/chat/api/kotlin/chat-client.mdx
  • src/pages/docs/chat/api/kotlin/connection.mdx
  • src/pages/docs/chat/api/kotlin/message-reactions.mdx
  • src/pages/docs/chat/api/kotlin/message.mdx
  • src/pages/docs/chat/api/kotlin/messages.mdx
  • src/pages/docs/chat/api/kotlin/occupancy.mdx
  • src/pages/docs/chat/api/kotlin/presence.mdx
  • src/pages/docs/chat/api/kotlin/room-reactions.mdx
  • src/pages/docs/chat/api/kotlin/room.mdx
  • src/pages/docs/chat/api/kotlin/rooms.mdx
  • src/pages/docs/chat/api/kotlin/typing.mdx

Comment on lines +75 to +80
### 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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n src/pages/docs/chat/api/kotlin/message-reactions.mdx | head -85

Repository: 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 f

Repository: ably/docs

Length of output: 35


🏁 Script executed:

rg -A5 'suspend function' src/pages/docs/chat/api/kotlin/ --type mdx

Repository: ably/docs

Length of output: 80


🏁 Script executed:

rg 'ChatException|ErrorInfo' src/pages/docs/chat/api/kotlin/ --type mdx | head -20

Repository: ably/docs

Length of output: 80


🏁 Script executed:

rg 'ChatException|ErrorInfo' src/pages/docs/chat/api/kotlin/ -A2 -B2

Repository: 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 -200

Repository: ably/docs

Length of output: 6893


🏁 Script executed:

rg -A3 'errorinfo|chatexception' src/pages/docs/chat/api/kotlin/ -i

Repository: ably/docs

Length of output: 15563


🏁 Script executed:

grep -n 'ErrorInfo\|ChatException' src/pages/docs/chat/api/kotlin/chat-client.mdx | head -30

Repository: 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.

Comment on lines +52 to +57
### 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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.mdx

Repository: 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 -100

Repository: 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 -20

Repository: 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 -u

Repository: 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.

Suggested change
### 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.

Comment on lines +44 to +49
### 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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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.mdx

Repository: 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 -100

Repository: 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 -80

Repository: 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.mdx

Repository: 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.

Comment on lines +45 to +50
### 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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find src/pages/docs/chat/api/kotlin -type f -name "*.mdx" | head -20

Repository: 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 -100

Repository: ably/docs

Length of output: 4832


🏁 Script executed:

rg "ErrorInfo|ChatException" src/pages/docs/chat/api/kotlin/chat-client.mdx -A 3 -B 3

Repository: ably/docs

Length of output: 1747


🏁 Script executed:

rg "ErrorInfo|ChatException" src/pages/docs/chat/api/kotlin/room-reactions.mdx -A 3 -B 3

Repository: ably/docs

Length of output: 272


🏁 Script executed:

grep -n "error" src/pages/docs/chat/api/kotlin/chat-client.mdx | head -20

Repository: ably/docs

Length of output: 1504


🏁 Script executed:

cat -n src/pages/docs/chat/api/kotlin/chat-client.mdx | tail -100

Repository: 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.

Comment on lines +70 to +75
### 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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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 -100

Repository: 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 -60

Repository: 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants