Skip to content

Add credentials fields to chrome.cast.media.LoadRequest for Cast Connect / Android TV usage#74959

Open
CHENPINCHIEH wants to merge 2 commits into
DefinitelyTyped:masterfrom
CHENPINCHIEH:fix-cast-credentials
Open

Add credentials fields to chrome.cast.media.LoadRequest for Cast Connect / Android TV usage#74959
CHENPINCHIEH wants to merge 2 commits into
DefinitelyTyped:masterfrom
CHENPINCHIEH:fix-cast-credentials

Conversation

@CHENPINCHIEH
Copy link
Copy Markdown

This PR adds missing credential-related fields to chrome.cast.media.LoadRequest in @types/chrome.

Context

In real-world Google Cast applications, launch and session identity information is propagated across different platforms (Web, Chromecast, and Android TV via Cast Connect).

While the official Cast SDK documentation does not explicitly define these as formal LoadRequest properties, they are used in practice as part of Cast Connect / Android TV launch data handling.

Changes

Added optional fields to LoadRequest:

  • credentials
  • credentialsType
  • atvCredentials
  • atvCredentialsType

These fields represent:

  • Generic Cast session credentials (Web / Chromecast)
  • Platform-specific override for Android TV (Cast Connect)

Rationale

  • Cast launch data is passed as opaque JSON and consumed by receiver applications.
  • Android TV (Cast Connect) implementations may differentiate authentication/identity data from generic Cast receivers.
  • These fields reflect an existing runtime pattern used in Cast Connect-based applications.

Notes

  • No changes to existing runtime behavior
  • All fields are optional and non-breaking
  • No modification to constructor or class implementation
  • Only type augmentation of existing LoadRequest

Test

Added type tests verifying:

  • LoadRequest accepts new credential fields
  • No breaking changes to existing media loading API

Add Credentials fields to LoadRequest
Fix update chrome FileSystem types to match dtslint expectations
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented May 6, 2026

@CHENPINCHIEH Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment that I will keep updated.

This PR touches some part of DefinitelyTyped infrastructure, so a DT maintainer will need to review it. This is rare — did you mean to do this?

1 package in this PR (and infra files)

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ❌ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 A DT maintainer needs to approve changes that affect DT infrastructure (package.json)

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 74959,
  "author": "CHENPINCHIEH",
  "headCommitOid": "391a1d886d71a244498d22106ba959ada7ddb5e1",
  "mergeBaseOid": "5afdcf191470cfb4efc44ff12fe66231ca64f1d9",
  "lastPushDate": "2026-05-06T09:02:00.000Z",
  "lastActivityDate": "2026-05-08T08:36:24.000Z",
  "hasMergeConflict": true,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": null,
      "kind": "edit",
      "files": [
        {
          "path": "package.json",
          "kind": "infrastructure"
        }
      ],
      "owners": [],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical",
      "isSafeInfrastructureEdit": false
    },
    {
      "name": "chrome",
      "kind": "edit",
      "files": [
        {
          "path": "types/chrome/chrome-cast/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/chrome/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/chrome/test/chrome-cast.ts",
          "kind": "test"
        },
        {
          "path": "types/chrome/test/index.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "matthewkimber",
        "otiai10",
        "sreimer15",
        "MatCarlson",
        "ekinsol",
        "echoabstract",
        "spasma",
        "bdbai",
        "JasonXian",
        "usertim",
        "idan315",
        "nicolas377",
        "idosal",
        "fregante",
        "erwanjugand"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "changereq",
      "reviewer": "erwanjugand",
      "date": "2026-05-08T08:36:24.000Z"
    }
  ],
  "mainBotCommentID": 4386520490,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @matthewkimber @otiai10 @sreimer15 @matcarlson @ekinsol @EchoAbstract @spasma @bdbai @JasonXian @userTim @idan315 @nicolas377 @idosal @fregante @erwanjugand — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot moved this to Waiting for Code Reviews in Pull Request Status Board May 6, 2026
@DangerBotOSS
Copy link
Copy Markdown

Formatting

The following files are not formatted:

  1. types/chrome/index.d.ts
  2. types/chrome/test/chrome-cast.ts

Consider running pnpm dprint fmt on these files to make review easier.

Generated by 🚫 dangerJS against 391a1d8

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in Pull Request Status Board May 6, 2026
Copy link
Copy Markdown
Contributor

@erwanjugand erwanjugand left a comment

Choose a reason for hiding this comment

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

Hi, this PR introduces changes that, in my opinion, shouldn’t be included (impact on Chrome extension types, infrastructure changes).

Also, how can your changes be tested?
I don’t understand why the Chromecast types are included here and how to test this.

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label May 6, 2026
@typescript-bot typescript-bot moved this from Needs Maintainer Action to Needs Author Action in Pull Request Status Board May 6, 2026
@typescript-bot
Copy link
Copy Markdown
Contributor

@CHENPINCHIEH One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-bot typescript-bot added the Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. label May 7, 2026
@typescript-bot
Copy link
Copy Markdown
Contributor

@CHENPINCHIEH Unfortunately, this pull request currently has a merge conflict 😥. Please update your PR branch to be up-to-date with respect to master. Have a nice day!

@CHENPINCHIEH
Copy link
Copy Markdown
Author

chrome.cast.media.LoadRequest

LoadRequest
Hi @erwanjugand

To clarify, I am currently developing/updating the sender side.

The reason this PR affects Chrome extension types is that the fields I'm adding are officially defined under chrome.cast.media.LoadRequest according to the Google Cast Official Documentation.

Since the cast-sender implementation directly inherits or references these types from the Chrome extension namespace, updating chrome.cast is a necessary step to ensure the sender-side types remain accurate and functional.

Comment thread package.json
"remark-validate-links": "^13.0.0",
"risk": "^0.0.4",
"typescript": "next"
"typescript": "^5.9.3"
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.

You shouldn't modify the repository's package.json

Comment thread types/chrome/index.d.ts
@@ -1,4 +1,3 @@
/// <reference types="filesystem" />
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.

The PR should only modify chrome-cast, not the types and tests related to Chrome extensions.

playbackRate?: number | undefined;
}

interface LoadRequest {
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 think this should be in the LoadRequest class.

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.

Missing queueData, requestId, sessionId and type keys ?

Comment on lines +17 to +20
loadRequest.credentials = 'user-123';
loadRequest.credentialsType = 'token';
loadRequest.atvCredentials = 'user-123-atv';
loadRequest.atvCredentialsType = 'token';
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.

Suggested change
loadRequest.credentials = 'user-123';
loadRequest.credentialsType = 'token';
loadRequest.atvCredentials = 'user-123-atv';
loadRequest.atvCredentialsType = 'token';
loadRequest.credentials = 'user-123'; // $ExpectType string | undefined
loadRequest.credentialsType = 'token'; // $ExpectType string | undefined
loadRequest.atvCredentials = 'user-123-atv'; // $ExpectType string | undefined
loadRequest.atvCredentialsType = 'token'; // $ExpectType string | undefined

Confirm that the values can be undefined.

Comment on lines +722 to +725
credentials?: string;
credentialsType?: string;
atvCredentials?: string;
atvCredentialsType?: string;
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.

Suggested change
credentials?: string;
credentialsType?: string;
atvCredentials?: string;
atvCredentialsType?: string;
credentials?: string | undefined;
credentialsType?: string | undefined;
atvCredentials?: string | undefined;
atvCredentialsType?: string | undefined;

If we can explicitly define undefined with exactOptionalPropertyTypes option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Edits Infrastructure Has Merge Conflict This PR can't be merged because it has a merge conflict. The author needs to update it. Revision needed This PR needs code changes before it can be merged.

Projects

Status: Needs Author Action

Development

Successfully merging this pull request may close these issues.

4 participants