Skip to content

[ECO-5728] Change RTP16a: presence on an ATTACHED channel waits for re-attach when not CONNECTED#490

Open
VeskeR wants to merge 2 commits into
mainfrom
ECO-5728/fix-presence-auto-reenter
Open

[ECO-5728] Change RTP16a: presence on an ATTACHED channel waits for re-attach when not CONNECTED#490
VeskeR wants to merge 2 commits into
mainfrom
ECO-5728/fix-presence-auto-reenter

Conversation

@VeskeR

@VeskeR VeskeR commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Replaces RTP16a (which routed presence on an ATTACHED channel to the
connection-wide queue) with RTP16d, splitting the handling by connection state:

  • RTP16d1: if CONNECTED, handled per RTL6c1.
  • RTP16d2: if not CONNECTED, queued at the channel level and sent once the
    channel next reaches ATTACHED (RTP5b).

This stops presence being flushed on connect (RTL3d) before a channel has
re-attached, which the server rejects. RTP16b, RTL11, the RTN7e note, the
channel-states-operations table, and the queueMessages IDL annotation now
reference the new clauses.

Implemented in ably-js: ably/ably-js#2241.

Resolves ECO-5728

…CONNECTED

Replace RTP16a with RTP16d, splitting the handling of presence messages on
an ATTACHED channel by connection state: when CONNECTED they are published
immediately (RTP16d1, per RTL6c1); when not CONNECTED they are queued at the
channel level (RTP16d2) and sent once the channel next reaches ATTACHED
(RTP5b), rather than placed on the connection-wide queue (RTL6c2). The
connection-wide queue is flushed on connect (RTL3d) before channels have
re-attached, which the server rejects for presence, as presence requires a
real (non-transient) attachment.

RTP16b, RTL11, the RTN7e note, the channel-states-operations table, and the
queueMessages IDL annotation are updated to reference the new clauses.

Resolves ECO-5728
@github-actions github-actions Bot temporarily deployed to staging/pull/490 June 9, 2026 12:09 Inactive
@VeskeR VeskeR changed the title RTP16d: presence on an ATTACHED channel waits for re-attach when not CONNECTED [ECO-5728] RTP16d: presence on an ATTACHED channel waits for re-attach when not CONNECTED Jun 9, 2026
@VeskeR VeskeR changed the title [ECO-5728] RTP16d: presence on an ATTACHED channel waits for re-attach when not CONNECTED [ECO-5728] Change RTP16a: presence on an ATTACHED channel waits for re-attach when not CONNECTED Jun 9, 2026
VeskeR added a commit to ably/ably-js that referenced this pull request Jun 9, 2026
On a transient disconnect that left a channel ATTACHED but the connection
not CONNECTED, a presence operation was routed to the connection-wide
queue (RTL6c2). On reconnect, RTL3d flushes that queue immediately, before
the channel completes its re-attachment, so the server rejected the
presence message with "not currently attached" (code 90001). Presence
requires a real (non-transient) server-side attachment, unlike messages
and objects which only need a transient one.

Now, when the channel is ATTACHED but the connection is not CONNECTED,
presence is queued at the channel level (RTP16d2) and sent once the
channel next reaches ATTACHED (RTP5b), honoring queueMessages.

Corresponding spec PR at [1]

Resolves ECO-5728

[1] ably/specification#490
Addresses review feedback on PR #2241 for ECO-5728. The earlier RTP16d
clause modelled presence queuing at the channel level based on the
connection state. The behaviour is instead specified at the connection
level, matching ably-java.

The new RTL3d2 requires that, when the connection becomes CONNECTED,
presence messages queued per RTL6c2 for a channel that RTL3d is
(re-)attaching are not sent immediately but queued at the channel level
per RTP16b, to be sent once the channel re-attaches (RTP5b). RTL3d's
parenthetical now carves these presence messages out of its
immediate-flush instruction.

@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

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.

2 participants