Skip to content

fix(storage): resolve strict linter and TypeScript errors - #9198

Open
thiyaguk09 wants to merge 4 commits into
googleapis:mainfrom
thiyaguk09:fix/storage-eslint-ts-errors
Open

fix(storage): resolve strict linter and TypeScript errors#9198
thiyaguk09 wants to merge 4 commits into
googleapis:mainfrom
thiyaguk09:fix/storage-eslint-ts-errors

Conversation

@thiyaguk09

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Aug 24, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors imports, formatting, and promise handling across several files, and updates tsconfig.json to include more test paths. However, several changes to promise chains (specifically refactoring .then(..., callback) to .then(...).catch(callback) or adding .catch() handlers) introduce critical bugs where callbacks can be invoked twice if the success callback throws an error. These issues affect getProjectId in service.ts, prepareRequest in util.ts, and createURI / createURIAsync in resumable-upload.ts.

Comment thread handwritten/storage/src/nodejs-common/service.ts Outdated
Comment thread handwritten/storage/src/nodejs-common/util.ts Outdated
Comment thread handwritten/storage/src/resumable-upload.ts Outdated
Comment thread handwritten/storage/src/resumable-upload.ts Outdated
@thiyaguk09
thiyaguk09 marked this pull request as ready for review August 24, 2026 07:28
@thiyaguk09
thiyaguk09 requested a review from a team as a code owner August 24, 2026 07:28
@github-actions
github-actions Bot requested a review from shivanee-p August 24, 2026 07:28
{
method: 'POST',
url: 'https://example.com',
// eslint-disable-next-line @typescript-eslint/no-explicit-any

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.

We are adding a few "// eslint-disable-next-line @typescript-eslint/no-explicit-any" comments especially in the test files to bypass the new linting rules. While this does work as a quick fix, it might be better to take this as an opportunity to remove the any casts wherever possible

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.

removed the any casts and the eslint-disable

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.

Thanks for the fixes, I took a look at the PR and still see a few eslint-diable comments lingering. Could we also address those ?

Comment thread handwritten/storage/test/resumable-upload.ts Outdated
@thiyaguk09
thiyaguk09 requested a review from Dhriti07 August 24, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants