Skip to content

1.0.0: rewrite on URLSession + async/await, zero dependencies - #23

Merged
SKrotkih merged 7 commits into
masterfrom
feature/v1-urlsession
Sep 15, 2026
Merged

SKrotkih merged 7 commits into
masterfrom
feature/v1-urlsession

Conversation

@SKrotkih

Copy link
Copy Markdown
Owner

Summary

From-scratch rewrite of the library. Details in CHANGELOG.md; migration table in README.md.

  • URLSession + Codable, no third-party dependencies, SPM only
  • async/await API, strict-concurrency clean, Sendable client
  • TokenProvider protocol replaces the built-in OAuth singleton and Info.plist keys; 401 → one retry with a refreshed token
  • monitor(broadcastID:) (AsyncThrowingStream<BroadcastEvent>) and goLive(broadcastID:) replace LiveLauncher + delegate
  • Typed YouTubeLiveError with Google's error payload
  • Fixes Description doesn't show up on video on youtube.com #17 (broadcast description), the latencyPreference type (from bug fixes #20), the liveBroadcasts.update body shape, boundStreamLastUpdateTimeMs type
  • 31 unit tests on a mock transport; CI: macOS SPM build/test, iOS simulator tests, tvOS/watchOS/visionOS builds
  • Platforms: iOS 15 / macOS 12 / tvOS 15 / watchOS 8 / visionOS 1

The pre-rewrite state is tagged legacy-0.2.45.

Test plan

  • swift build && swift test — 31/31 locally (macOS 14, arm64)
  • CI green on all five jobs (run Watermark feature  #4)
  • Smoke test against a real channel with the updated LiveEvents sample (follow-up)

🤖 Generated with Claude Code

https://claude.ai/code/session_01KJJZJaTpLH4M7UgHQ9CgWr

SKrotkih and others added 7 commits September 15, 2026 07:18
…ncies

- New YouTubeLiveClient (Sendable) covering liveBroadcasts list/insert/update/
  delete/bind/transition and liveStreams list/insert/update/delete
- TokenProvider protocol replaces GoogleOAuth2 singleton and Info.plist keys;
  one automatic retry on 401 with a refreshed token
- HTTPTransport seam (URLSession conforms) for testability
- Typed YouTubeLiveError with parsed Google error payload
- Models on plain Codable; lenient enums (unknown -> .unknown); RFC 3339 dates
- Fixes carried over from 0.2.x: update body no longer nests status/
  contentDetails in snippet; latencyPreference is a string enum;
  boundStreamLastUpdateTimeMs is a date; PUT bodies omit read-only fields
- Drop Moya, Alamofire, SwiftyJSON, KeychainAccess, CocoaPods and the xcodeproj
- 18 XCTest cases on a mock transport with API-shaped fixtures
- README rewritten for 1.0 with a migration table

Legacy 0.2.x state is preserved under tag legacy-0.2.45.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJJZJaTpLH4M7UgHQ9CgWr
- client.monitor(broadcastID:options:) polls broadcast + bound stream and emits
  snapshot / encoderConnected / transitionRequested / transitionFailed / testing /
  live / pollFailed / ended events
- Drives ready -> testing -> live (monitor stream on) or ready -> live (off) once
  the encoder is sending; retries refused transitions; tolerates transient poll
  failures; stops on cancellation or when the broadcast ends
- client.goLive(broadcastID:timeout:) convenience
- New errors: .timeout(lastKnown:), .broadcastEnded
- 13 tests on a stateful FakeYouTube transport routed by URL path
- README: "Going live" section and migration rows

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJJZJaTpLH4M7UgHQ9CgWr
…tvOS/watchOS/visionOS builds

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJJZJaTpLH4M7UgHQ9CgWr
…n); checkout@v5

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJJZJaTpLH4M7UgHQ9CgWr
…orms on macos-15); pick iPhone simulator by UDID

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJJZJaTpLH4M7UgHQ9CgWr
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KJJZJaTpLH4M7UgHQ9CgWr
@SKrotkih
SKrotkih merged commit c12aaab into master Sep 15, 2026
10 checks passed
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.

Description doesn't show up on video on youtube.com

1 participant