Skip to content

Fix Kick game persistence. - #6139

Merged
michelinewu merged 2 commits into
masterfrom
mw_kick_search_games
Aug 27, 2026
Merged

Fix Kick game persistence.#6139
michelinewu merged 2 commits into
masterfrom
mw_kick_search_games

Conversation

@michelinewu

@michelinewu michelinewu commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Persist the Selected Kick Category Across the Go Live and Edit Stream Windows

Issues

Selecting a Kick category did not persist. The field reverted to the previous category, or rendered a bare numeric id, and the choice was invisible to everything downstream of the form.

The selection never reached service state. GameSelector renders its value from the service but sends changes to the form, and nothing joined the two for Kick. KickEditStreamInfo.tsx:37 binds the selector with {...bind.game}, supplying both value and onChange, but GameSelector never reads p.value — it computes its own from platformService.state.settings.game (line 27) and Services.KickService.state.gameName (line 43), then renders <ListInput value={selectedGameId}>. onSelect wrote back to the service for TikTok and Twitch (TikTokService.actions.setGameName, TwitchService.actions.setGameInfo) but had no Kick branch, so after a Kick selection the form held the new id while the service still held the old one, and the next render read the service and reverted.

Fixes

Give KickService a write-back method and call it from the selector, mirroring the Twitch branch that already sits beside it. setGameInfo({ gameId, gameName }) writes UPDATE_STREAM_SETTINGS({ game: gameId, gameName }) and SET_GAME_NAME(gameName), covering both the id the API needs and the name the component renders.

Move the name inside settings so the saved-settings path can see it. gameName?: string is added to IKickStartStreamSettings and IKickStartStreamOptions, seeded as '' in initialState, and — critically — mirrored by the SET_GAME_NAME mutation itself rather than at each call site.

The top-level state.gameName is deliberately kept rather than replaced, because GameSelector.tsx:43 still reads it.

StreamInfoView.game and .gameName gain Kick clauses, so the common-field getters resolve for a Kick-only stream instead of returning ''.

searchGames builds its query with URLSearchParams, matching putChannelInfo, and guards the response with typeof res !== 'object' before casting — logging a distinct message so a diagnostic log separates "the API answered with no categories" from "we never reached the API". Both paths still resolve to [], so callers are unaffected.

fetchGame returns an empty IGame for a falsy name instead of issuing a request.

Files changed: app/services/platforms/kick.ts, app/components-react/windows/go-live/GameSelector.tsx, app/services/streaming/streaming-view.ts

Performance Implications

Net reduction. The fetchGame guard removes one HTTP request per app start, on the path that runs while the Go Live window is loading. Nothing new is requested. The costs are one optional string in Kick's settings object, one object spread per SET_GAME_NAME call, and two mutations on an explicit user selection — all negligible against the request they replace.

Copilot AI lite review requested due to automatic review settings August 27, 2026 21: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.

Pull request overview

This pull request fixes Kick category (“game”) persistence by ensuring GameSelector writes Kick selections back into KickService state (ID + name), and by exposing Kick’s game/gameName through the shared StreamInfoView getters used across windows.

Changes:

  • Add Kick gameName to stream settings/options, seed it in initial state, and mirror it into settings via SET_GAME_NAME for persistence.
  • Add KickService.setGameInfo({ gameId, gameName }) and call it from GameSelector when the active platform is Kick.
  • Extend StreamInfoView.game / .gameName to resolve Kick values; adjust Kick searchGames query building and add a fetchGame empty-name guard.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
app/services/platforms/kick.ts Persist Kick gameName alongside game, add setGameInfo, and adjust game search/fetch behavior.
app/components-react/windows/go-live/GameSelector.tsx Write Kick game selection back into KickService so UI/service stay in sync.
app/services/streaming/streaming-view.ts Allow common game / gameName getters to return Kick values when Kick is enabled.

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

Comment on lines 426 to 432
async searchGames(searchString: string): Promise<IGame[]> {
const host = this.hostsService.streamlabs;
const url = `https://${host}/api/v5/slobs/kick/info?category=${searchString}`;
const params = new URLSearchParams({ category: searchString });
const url = `https://${host}/api/v5/slobs/kick/info?${params.toString()}`;
const headers = authorizedHeaders(this.userService.apiToken);
const request = new Request(url, { headers });

@bundlemon

bundlemon Bot commented Aug 27, 2026

Copy link
Copy Markdown

BundleMon

Files updated (1)
Status Path Size Limits
renderer.(hash).js
10.48MB (+6.33KB +0.06%) -
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 +6.33KB +0.04%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@gettinToasty gettinToasty 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.

i agree with copilot that the guard clause should be before the http request but otherwise looks good

Copilot AI review requested due to automatic review settings August 27, 2026 21:37

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

app/services/platforms/kick.ts:480

  • setGameInfo writes gameName into settings via UPDATE_STREAM_SETTINGS, then immediately calls SET_GAME_NAME, which now also mirrors gameName into state.settings. This double-writes the same field; consider letting SET_GAME_NAME be the single place that mirrors the name into settings and only updating the id via UPDATE_STREAM_SETTINGS.
  setGameInfo({ gameId, gameName }: { gameId: string; gameName: string }) {
    this.UPDATE_STREAM_SETTINGS({ game: gameId, gameName });
    this.SET_GAME_NAME(gameName);
  }

Comment thread app/services/platforms/kick.ts
@michelinewu
michelinewu merged commit 9f256d6 into master Aug 27, 2026
6 of 13 checks passed
@michelinewu
michelinewu deleted the mw_kick_search_games branch August 27, 2026 21:46
michelinewu added a commit that referenced this pull request Aug 29, 2026
michelinewu added a commit that referenced this pull request Aug 29, 2026
* Revert "Fix padding on live output editing toggles. (#6143)"

This reverts commit a202ab6.

* Revert "Multistream Toggle Fixes and Error Handling (#6141)"

This reverts commit 2ec1daf.

* Revert "Disable enhanced broadcasting when live output editing is enabled. (#6121)"

This reverts commit bfd48b5.

* Revert "Add live output editing display selector handling. (#6120)"

This reverts commit f59c58a.

* Revert "Add dismissable to AI Highlighter toggle in Edit Stream window. (#6128)"

This reverts commit 5fa1b1b.

* Revert "Edit stream window. (#6119)"

This reverts commit eab5de9.

* Revert "Update go live checklist. (#6118)"

This reverts commit 4549e56.

* Revert "Fix Kick game persistence. (#6139)"

This reverts commit 9f256d6.

* Revert "Add go live info banner. (#6116)"

This reverts commit 75336b0.

* Revert "Move SwitcherCard tooltip hover to toggle. (#6115)"

This reverts commit 056d5da.

* Revert "Fix tooltip wrapping. (#6114)"

This reverts commit 153aa3f.

* Revert "Add button to footer. (#6113)"

This reverts commit 9f3cd65.

* Revert "Add disabled radio button styling. (#6112)"

This reverts commit 877db2a.

* Revert "Fix onboarding test (#6132)"

This reverts commit e439f6f.

* Revert "Add small and inline Spinner variants. (#6111)"

This reverts commit ae6c143.
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