Skip to content

Fix presence auto re-enter error message missing clientId (RTP17e) - #2314

Open
cpruijsen wants to merge 1 commit into
ably:mainfrom
cpruijsen:fix/issue-2209
Open

cpruijsen wants to merge 1 commit into
ably:mainfrom
cpruijsen:fix/issue-2209

Conversation

@cpruijsen

@cpruijsen cpruijsen commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

RealtimePresence._ensureMyMembersPresent() interpolates entry.clientId into the 91004 ErrorInfo on the channel update that auto re-enter already emits when the ENTER was NACKed. RTP17e requires that message to name the member that failed to re-enter.

The UTS test that asserts reason.message includes my-client now runs without RUN_DEVIATIONS, and the matching deviations.md entry is removed.

Decision: put entry.clientId into the current 'Presence auto re-enter failed' string, quoted like the MICRO log in the same function. Alternative: copy Dart (Automatic re-entry failed for clientId "...") or .NET (Cannot automatically re-enter {clientId} on channel {channelName}). The spec and the UTS test only require the clientId to appear, so keeping the existing phrase is the smallest change. Can switch to a sibling SDK's string.

Independent of #2301.

Fixes #2209

Test plan

  • npx mocha --no-config --exit --require tsx/cjs --timeout 30000 --grep "RTP17e - failed re-entry emits UPDATE with error" test/uts/realtime/unit/presence/realtime_presence_reentry.test.ts passes without RUN_DEVIATIONS (Node 20)
  • Same grep fails if the source string is reverted to the fixed message (expected 'Presence auto re-enter failed' to include 'my-client')
  • The other five tests in realtime_presence_reentry.test.ts still pass

Summary by CodeRabbit

  • Bug Fixes
    • Error messages for failed automatic presence re-entry now include the affected member’s client ID. This provides more context when diagnosing a re-entry failure and distinguishes which client connection was affected. The updated behavior is covered by a test that runs without requiring a deviation-based skip.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cff7c73e-f910-4b4f-87fb-a446a405eeb1
📥 Commits

Reviewing files that changed from the base of the PR and between 1b914e5 and d6d9041.

📒 Files selected for processing (3)
  • src/common/lib/client/realtimepresence.ts
  • test/uts/deviations.md
  • test/uts/realtime/unit/presence/realtime_presence_reentry.test.ts
💤 Files with no reviewable changes (2)
  • test/uts/realtime/unit/presence/realtime_presence_reentry.test.ts
  • test/uts/deviations.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.


Walkthrough

The automatic presence re-entry failure message now includes the affected clientId. The RTP17e test no longer has a RUN_DEVIATIONS-based skip, and the related deviation entry was removed.

Changes

Presence Re-entry Error Message

Layer / File(s) Summary
Update and validate re-entry error message
src/common/lib/client/realtimepresence.ts, test/uts/realtime/unit/presence/realtime_presence_reentry.test.ts, test/uts/deviations.md
The failure message now includes the affected clientId. The RTP17e test runs without the conditional skip, and its deviation entry was removed.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: ttypic

Merge Risk: ⚪ Minimal · up to d6d90

Failed automatic re-entry now identifies the affected client in the 91004 message, and the enabled regression test checks that value. No actionable merge-blocking risk remains in the reviewed changes.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: fixing the presence auto-re-entry error message to include the missing clientId.
Linked Issues check ✅ Passed The change satisfies issue #2209. In RealtimePresence._ensureMyMembersPresent, the 91004 ErrorInfo message now includes entry.clientId in the existing automatic re-entry failure message. The RTP…
Out of Scope Changes check ✅ Passed The changes remain within issue #2209. They update the required error message and enable the matching RTP17e test by removing its deviation skip and documentation. No unrelated production or test chan…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the message line
The clientId now appears
The test runs without a skip
The old deviation disappears
Soft paws approve the change ∎

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

@ttypic ttypic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for contribution!

RTP17e requires the 91004 ErrorInfo on a failed automatic re-enter to
name the member. Interpolate entry.clientId into the existing message,
unskip the UTS assertion, and drop the resolved deviations.md entry.

This branch has not been deployed

No deployments
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.

Presence re-entry error message does not include clientId (RTP17e)

2 participants