Skip to content

Make "connected to" log show up after every join, not just after fresh connections#1873

Merged
1egoman merged 2 commits intomainfrom
move-connected-log-within-join
Apr 7, 2026
Merged

Make "connected to" log show up after every join, not just after fresh connections#1873
1egoman merged 2 commits intomainfrom
move-connected-log-within-join

Conversation

@1egoman
Copy link
Copy Markdown
Contributor

@1egoman 1egoman commented Apr 6, 2026

Previously, the code roughly did this:

// in Room.connectSignal:
const joinResponse = await engine.join(/* ... */);

this.serverInfo = /* computed from joinResponse */;

this.log.debug('connected to Livekit Server ... (with this.serverInfo data in here)'); 

This meant that the connected to Livekit Server ... log would log only on connect, not for reconnects.

So instead, I moved the log one level deeper, into RTCEngine.join:

// in RTCEngine.join:
// (preexisting join logic unchanged, joinResponse still comes from lower level this.client.join call)
const serverInfo = /* computed from joinResponse */;
this.log.debug('connected to Livekit Server ... (with serverInfo data in here)'); 
return { joinResponse, serverInfo };

// in Room.connectSignal:
const { joinResponse, serverInfo } = await engine.join(/* ... */);
this.serverInfo = serverInfo;
// (Log not here anymore)

With this change, the log shows up anytime a join occurs, whether it be fresh or for a reconnect. And the log still shows up in the same place on a fresh connect so the existing behavior should remain the same.

@boks1971 Does this address your concern? Is there a need to somehow disambiguate the log that is shown to determine if it is from a fresh connect or some type of reconnect, or is the context before / after the log good enough to tell this?

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 6, 2026

🦋 Changeset detected

Latest commit: e2912a1

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@1egoman 1egoman requested review from boks1971 and lukasIO April 6, 2026 14:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 95.35 KB (+0.12% 🔺)
dist/livekit-client.umd.js 104.19 KB (-0.04% 🔽)

Copy link
Copy Markdown
Contributor

@boks1971 boks1971 left a comment

Choose a reason for hiding this comment

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

that's good @1egoman . Can get the connect/reconnect from context.

Copy link
Copy Markdown
Contributor

@lukasIO lukasIO left a comment

Choose a reason for hiding this comment

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

nice!

@1egoman 1egoman merged commit 5864b2a into main Apr 7, 2026
6 checks passed
@1egoman 1egoman deleted the move-connected-log-within-join branch April 7, 2026 14:58
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.

3 participants