[1] Multistream Toggle - Add runtime target functions and error handling. - #6051
Open
michelinewu wants to merge 2 commits into
Open
[1] Multistream Toggle - Add runtime target functions and error handling.#6051michelinewu wants to merge 2 commits into
michelinewu wants to merge 2 commits into
Conversation
BundleMonFiles updated (1)
Unchanged files (3)
Total files change +5.58KB +0.04% Final result: ✅ View report in BundleMon website ➡️ |
gettinToasty
approved these changes
Jul 27, 2026
wesrupert
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Runtime Target Management for Mid-Stream Multistream Toggle
Stack:
master← 1 ← 2 ← 3 ← 4 ← 5Summary
Adds runtime target add/remove/update functionality to the Restream service, enabling mid-stream platform toggling.
Restream Service (
app/services/restream.ts)New interfaces:
IRestreamTargetData— payload shape for creating runtime targets (server URL, stream key, platform, label, mode)IRestreamRuntimeTarget— response shape from the runtime API (addsid,state, timestamps)TRestreamTarget— union ofIRestreamTarget | IRestreamRuntimeTargetIRestreamResponse— generic API response wrapper withsuccessandmessageNew methods:
addRuntimeTargets(targets)/removeRuntimeTargets(targetIds)— low-level POST/DELETE to/api/v1/rst/targets/runtimeaddTargets(platforms, destinations, mode)— high-level orchestrator that formats platform and custom destination data into runtime target payloads and callsaddRuntimeTargetsremoveTargets(platforms, destinations, mode)— finds matching existing targets and callsremoveRuntimeTargetswith their IDsupdateTargets(platforms, destinations, mode)— diff-based update: removes targets no longer needed, adds new onesupdateTargetsAndValidate(platforms, destinations, mode)— wrapsupdateTargetswith error handling and target state validationfilterTargetsByMode(targets, mode)— filters targets by display orientation (horizontal/vertical)isPlatformTarget(target)— type guard distinguishing platform targets from custom destinationsformatRuntimePlatformData(platform, mode)— buildsIRestreamTargetDatafrom platform settings (supports Twitch, YouTube, Facebook, TikTok, Trovo, X, Kick, Instagram, Patreon)formatRuntimeCustomDestinationData(destination, mode)— buildsIRestreamTargetDatafrom custom destination settingsUpdated existing methods:
createTargets— now accepts optionallabelfield on targetsIRestreamTarget.platform— type widened fromTPlatformtoTPlatform | 'relay', added optionallabelStream Error (
app/services/streaming/stream-error.ts)RESTREAM_UPDATE_FAILEDerror type for failures during mid-stream target updatesFiles changed:
app/services/restream.tsapp/services/streaming/stream-error.tsPerformance Implications
None. New methods added but none of them are currently called in the application.