Skip to content

Fix platform type checking#5962

Open
sandboxcoder wants to merge 2 commits into
stagingfrom
rno/fix-platform-service-warning
Open

Fix platform type checking#5962
sandboxcoder wants to merge 2 commits into
stagingfrom
rno/fix-platform-service-warning

Conversation

@sandboxcoder

@sandboxcoder sandboxcoder commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
  • twitch.js: revert putChannelInfo now that root cause has been addressed
  • platforms/index.ts: switch putChannelInfo from property shorthand to method shorthand, which uses bivariant parameter checking instead of strict contravariance
    Fix this warning:
image

* twitch.js: revert putChannelInfo now that root cause has been addressed
* platforms/index.ts: switch putChannelInfo from property shorthand to method
shorthand, which uses bivariant parameter checking instead of strict contravariance

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 PR resolves a TypeScript platform-service type-checking warning by adjusting putChannelInfo typing: Twitch’s implementation is reverted to accept full Twitch start-stream settings again, and the shared IPlatformService contract is updated to use a method signature to avoid strict contravariant parameter checking across platform implementations.

Changes:

  • Revert TwitchService.putChannelInfo parameter type from Partial<ITwitchStartStreamOptions> back to ITwitchStartStreamOptions.
  • Change IPlatformService.putChannelInfo from a function-typed property to a method signature to use bivariant parameter checking.

Reviewed changes

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

File Description
app/services/platforms/twitch.ts Reverts putChannelInfo to require full Twitch start-stream settings.
app/services/platforms/index.ts Updates IPlatformService.putChannelInfo to a method signature to address TS variance checking.
Comments suppressed due to low confidence (1)

app/services/platforms/twitch.ts:519

  • ITwitchStartStreamOptions requires tags and contentClassificationLabels, but this method still treats them as optional (if (settings.tags) / optional chaining). This makes the warning branch effectively dead and leaves the code out of sync with the new (non-Partial) signature.
  async putChannelInfo(settings: ITwitchStartStreamOptions): Promise<void> {
    if (settings.tags) {
      this.twitchTagsService.actions.setTags(settings.tags);
    } else {
      console.warn('Trying to update Twitch channel info without tags, skipping tag update');
    }
    const hasPermission = await this.hasScope('channel:manage:broadcast');
    const scopedTags = hasPermission ? settings.tags : undefined;

    // Twitch seems to require you to add a label with disabled to remove it
    const labels = this.twitchContentClassificationService.options.map(option => ({
      id: option.value,
      is_enabled: settings.contentClassificationLabels?.includes(option.value),
    }));

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/services/platforms/index.ts
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@bundlemon

bundlemon Bot commented Jun 5, 2026

Copy link
Copy Markdown

BundleMon

Files added (4)
Status Path Size Limits
renderer.(hash).js
+7.77MB -
vendors~renderer.(hash).js
+4.67MB -
updater.js
+115.29KB -
guest-api.js
+40.23KB -

Total files change +12.59MB

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

@sandboxcoder sandboxcoder marked this pull request as ready for review June 5, 2026 21:56
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.

2 participants