Skip to content

Fix/guard connection state#114

Open
siddimore wants to merge 2 commits intolivekit:mainfrom
siddimore:fix/guard-connection-state
Open

Fix/guard connection state#114
siddimore wants to merge 2 commits intolivekit:mainfrom
siddimore:fix/guard-connection-state

Conversation

@siddimore
Copy link
Copy Markdown
Contributor

Summart

Three independent improvements bundled together as non-breaking maintenance work: include guard consistency, a missing read-only accessor, and test gaps filled.

Changes

  • Four public headers used #ifndef/#define/#endif guards while every other header in livekit already used #pragma once. Converted for consistency. No functional change.

Room::connectionState() accessor
connection_state_ was private with no public getter. Callers who need the current state had to track it themselves via RoomDelegate::onConnectionStateChanged.

Fix VideoStream class-level doc comment
The class description block was copy-pasted from AudioStream and still referred to PCM audio, AudioFrameEvent, and int16 samples. Updated to describe video correctly.

Tests

  • test_room_callbacks.cpp — 3 new cases for connectionState()

siddimore added 2 commits May 2, 2026 21:51
- Convert #ifndef include guards to #pragma once in result.h,
  data_track_error.h, room.h, and subscription_thread_dispatcher.h
  for consistency with the rest of the public headers
- Add Room::connectionState() public accessor (lock-guarded, purely
  additive — no existing API changed)
- Fix VideoStream class-level doc comment (was copy-pasted from
  AudioStream: wrong class name and example types)
- Add unit tests for Room::connectionState() in test_room_callbacks.cpp
- Add unit tests for Result<T,E> and Result<void,E> in test_result.cpp
  (addresses TODO in result.h requesting invariant test coverage)
@siddimore siddimore marked this pull request as ready for review May 4, 2026 03:33
Copy link
Copy Markdown
Contributor

@stephen-derosa stephen-derosa left a comment

Choose a reason for hiding this comment

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

awesome thanks for the fixes/tests!

Copy link
Copy Markdown
Contributor

@alan-george-lk alan-george-lk left a comment

Choose a reason for hiding this comment

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

Approved with nitpick on grammar -- thanks for the contribution!

/// Note: std::move on a const& silently falls back to a copy, so we assign
/// directly. Changing the virtual signature to take by value would enable
/// a true move but is an API-breaking change left for a future revision.
/// a true move but is a API-breaking change hence left for a future revision.
Copy link
Copy Markdown
Contributor

@alan-george-lk alan-george-lk May 4, 2026

Choose a reason for hiding this comment

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

Nit: should still be an (right?)

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