CtrlK
BlogDocsLog inGet started
Tessl Logo

guydemo/pubnub-presence

Implement real-time presence tracking with PubNub

79

1.07x

Quality

67%

Does it follow best practices?

Impact

98%

1.07x

Average score across 5 eval scenarios

Overview
Skills
Evals
Files

task.mdevals/scenario-2/

Presence-Enabled Chat Application Setup

Context

You are building a browser-based chat application where users see who is online in their chat room. A common complaint from users is that when someone closes their browser tab, they remain shown as "online" for several minutes before disappearing. You need the online list to update as quickly as possible when users leave.

Additionally, users who refresh the page or return after a brief network outage should not lose track of who is in the room.

The application will be used for real-time team communication with moderate activity (teams of 10-50 people).

Task

Write the PubNub initialization and presence setup code for a browser-based chat application that:

  1. Creates and configures a PubNub instance with appropriate settings for a real-time chat use case
  2. Ensures users have consistent identity across browser sessions
  3. Subscribes to a chat room channel with presence tracking
  4. Handles connection lifecycle events to keep the presence state accurate -- both on initial connect and after any reconnections
  5. Ensures that when a user closes or navigates away from the page, they are removed from the online list as quickly as possible

Expected Outputs

A single JavaScript file chat-presence-setup.js containing the PubNub initialization, presence subscription, connection lifecycle handling, and cleanup logic.

Install with Tessl CLI

npx tessl i guydemo/pubnub-presence

evals

SKILL.md

tile.json