Skip to content

fix: leave the current agent out of presence viewers - #273

Merged
mpge merged 1 commit into
escalated-dev:mainfrom
john-dent:fix/presence-current-user
Dec 1, 2026
Merged

mpge merged 1 commit into
escalated-dev:mainfrom
john-dent:fix/presence-current-user

Conversation

@john-dent

@john-dent john-dent commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #272.

With broadcasting on, PresenceIndicator joins the ticket's presence channel, and Echo's here() includes the current user, so agents always saw themselves in "Also viewing" and the indicator was never empty. The polling endpoint already leaves the requesting user out, so the two modes disagreed.

Changes

  • PresenceIndicator takes a currentUserId prop (the same name ChatThread, ReplyThread and TicketDetailPane use) and leaves that user out of here() and joining(). Without the prop it behaves as before.
  • TicketDetailPane passes its currentUserId through.
  • Tests: the current agent is left out of the channel members, the indicator is empty when they're the only viewer, and the agent ticket page passes the agent through. All three fail without the fix.
  • CHANGELOG (Unreleased, Fixed) and a line in docs/package-maintainers.md for standalone consumers.

Checks

npm run lint, npm run format:check and npm run pages:check pass on Node 26, as does npm test apart from tests/packaging.test.js. That fails the same way on main in my local setup (git refuses the checkout's ownership there), so I'm leaving it to CI.

An Echo presence channel's members include the current user, so with
broadcasting on PresenceIndicator always listed the agent in "Also
viewing". Add a currentUserId prop that leaves that user out, as the
polling endpoint already does, and pass it from TicketDetailPane.

Fixes escalated-dev#272
@mpge
mpge merged commit 4561d9e into escalated-dev:main Dec 1, 2026
@mpge

mpge commented Dec 1, 2026

Copy link
Copy Markdown
Member

Review and thank you - merged !

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PresenceIndicator lists the current agent as "also viewing" when using Echo presence channels

2 participants