Skip to content

Fix unprotected mode go live - #6264

Merged
michelinewu merged 7 commits into
masterfrom
mw_fix_unprotected_go_live
Oct 2, 2026
Merged

michelinewu merged 7 commits into
masterfrom
mw_fix_unprotected_go_live

Conversation

@michelinewu

Copy link
Copy Markdown
Contributor

Fixes for Unprotected Mode, mostly for Twitch

Issues

  • Non-Twitch destinations could open the Go Live window in unprotected mode.
  • A custom server of auto was not treated as Twitch. isTwitchStreamDestination() rejected an rtmp_custom destination whose server is auto, so it never counted as an unprotected Twitch stream.
  • Unprotected Twitch was keyed on the primary platform.
  • The Go Live window's feature cards showed in unprotected mode.

Fixes

  • StartStreamingButton.tsx: unprotected mode is decided first, before any other check.
  • stream-destination.ts: an rtmp_custom server equal to auto (trimmed, case-insensitive) counts as a Twitch destination.
  • streaming-view.ts isTwitchUnprotectedStream: checks isPlatformLinked('twitch') instead of isPrimaryPlatform('twitch'). The Twitch title/game flow only needs a linked Twitch account. In unprotected mode the Go Live window lists only Twitch (PlatformSettings.validEnabledPlatforms), and its primary-chat value falls back to the enabled platform, so nothing there depends on Twitch being primary.
  • streaming-view.ts showFeatureToggleCards: now also checks for protectedModeEnabled.

Tests:

  • twitch-stream-destination.ts: the unresolved automatic selection case (rtmp_custom + auto) now expects twitch: true.
  • settings/streaming.ts ("Populates stream settings after go live"): switching a custom ingest to Streaming Services now expects the stream key to be cleared, matching OSN's saveStreamSettings().
  • twitch.ts ("Migrate the twitch account to the protected mode"): ends the stream with stopStream() and corrects the assertion for "Use recommended settings" is not shown after migration.

Files changed: app/components-react/root/StartStreamingButton.tsx, app/services/streaming/stream-destination.ts, app/services/streaming/streaming-view.ts, test/regular/settings/streaming.ts, test/regular/streaming/twitch-stream-destination.ts, test/regular/streaming/twitch.ts

Performance Implications

Negligible, and slightly net-positive. isPlatformLinked is a property lookup on the auth platforms map, the same cost as the isPrimaryPlatform comparison it replaces, and the auto check is one string comparison before the existing URL parse.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 18:31
@michelinewu michelinewu changed the title Mw fix unprotected go live Fix unprotected mode go live Oct 2, 2026
@michelinewu michelinewu added the bug label Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The feature-card change accidentally removes the rollout gate, exposing gated controls to all protected-mode users.

Review effort: Balanced
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Fixes unprotected Go Live behavior, Twitch destination detection, and related tests.

Changes:

  • Restricts unprotected Go Live windows to Twitch destinations.
  • Recognizes custom auto servers as Twitch.
  • Updates feature-card visibility and streaming tests.
File Description
StartStreamingButton.tsx Prioritizes unprotected-mode routing.
stream-destination.ts Recognizes Twitch automatic selection.
streaming-view.ts Updates Twitch eligibility and feature-card visibility.
settings/​streaming.ts Updates stream-key transition tests.
twitch-stream-destination.ts Updates automatic-selection expectation.
twitch.ts Corrects migration stream cleanup and assertion.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/components-react/root/StartStreamingButton.tsx
Comment thread app/services/streaming/streaming-view.ts
Comment thread app/services/streaming/streaming-view.ts
Comment thread test/regular/settings/streaming.ts Outdated
@bundlemon

bundlemon Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

BundleMon

Files updated (1)
Status Path Size Limits
✅ renderer.(hash).js
10.66MB (-67B 0%) -
Unchanged files (3)
Status Path Size Limits
✅ vendors~renderer.(hash).js
4.67MB -
✅ updater.js
115.29KB -
✅ guest-api.js
40.23KB -

Total files change -67B 0%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

Copilot AI balanced review requested due to automatic review settings October 2, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The React path still performs blocking synchronous service IPC, and several updated test diagnostics are misleading.

Review effort: Balanced
Findings: None

Resolved since last review (4)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Avoid synchronous IPC in stream toggle predicate

app/​components-react/​root/​StartStreamingButton.tsx:230

This direct service method call performs synchronous IPC from the React renderer and can block the UI while the worker responds. Because this predicate needs the result, make shouldShowGoLiveWindow asynchronous, await StreamSettingsService.actions.return.isSafeToModifyStreamKey(), and await the predicate in handleToggleStreaming.

Low severity Correct comment describing streaming mode transition

test/​regular/​settings/​streaming.ts:47

This comment reverses the actual transition: the form starts in Custom Streaming Server mode, and the next line switches it to Streaming Services. Correcting the direction will keep the test narrative aligned with the behavior.

@michelinewu
michelinewu merged commit de2642f into master Oct 2, 2026
11 of 15 checks passed
@michelinewu
michelinewu deleted the mw_fix_unprotected_go_live branch October 2, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants