Skip to content

fix: upgrade @types/sinon to unblock build in bigquery-storage#8098

Open
danieljbruce wants to merge 1 commit intomainfrom
bigquery-storage-pin-sinon
Open

fix: upgrade @types/sinon to unblock build in bigquery-storage#8098
danieljbruce wants to merge 1 commit intomainfrom
bigquery-storage-pin-sinon

Conversation

@danieljbruce
Copy link
Copy Markdown
Contributor

@danieljbruce danieljbruce commented Apr 22, 2026

Description

Even though @types/sinon is pinned, it relies on the type definitions provided by @sinonjs/fake-timers. In fake-timers the FakeTimerInstallOpts interface was recently removed which breaks the old version of @types/sinon that relies on this interface. We should increase the version number to unblock the build.

Impact

Unblocks the build so that we can run the system tests and unit tests with bigquery-storage

Additional Information

The main difference for the upgrade is that the upgraded version seems to only work with Node 18+, but since this targets the devDependencies then this will only affect development environments and we only support Node 18+ anyway.

@danieljbruce danieljbruce requested a review from a team as a code owner April 22, 2026 21:16
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the @types/sinon dependency in package.json. A review comment identifies a version mismatch between the type definitions and the underlying library, suggesting a patch update within the v17 range instead of a major version bump to maintain type safety.

"@types/mocha": "^10.0.10",
"@types/node": "^22.13.14",
"@types/sinon": "^17.0.4",
"@types/sinon": "^21.0.0",
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.

medium

Upgrading @types/sinon to ^21.0.0 while the underlying sinon library remains on an older version (v17) creates a mismatch between the type definitions and the actual runtime API. This can lead to the TypeScript compiler failing to catch incompatible method calls or incorrectly validating parameters. To maintain type safety, it is recommended to use a patch version within the v17 range (e.g., ^17.0.5) that addresses the fake-timers dependency issue, or to upgrade the sinon package itself to v21.

Suggested change
"@types/sinon": "^21.0.0",
"@types/sinon": "^17.0.5",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

^17.05 isn't even a valid version (https://www.npmjs.com/package/@types/sinon?activeTab=versions). Also, sinon is at v21.

Copy link
Copy Markdown
Contributor Author

@danieljbruce danieljbruce left a comment

Choose a reason for hiding this comment

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

See if gemini responds.

"@types/mocha": "^10.0.10",
"@types/node": "^22.13.14",
"@types/sinon": "^17.0.4",
"@types/sinon": "^21.0.0",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

^17.05 isn't even a valid version (https://www.npmjs.com/package/@types/sinon?activeTab=versions). Also, sinon is at v21.

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