Skip to content

fix: resolve this-binding bug blocking vitest 4 upgrade#318

Open
russongit wants to merge 1 commit into
Mathieu2301:mainfrom
russongit:main
Open

fix: resolve this-binding bug blocking vitest 4 upgrade#318
russongit wants to merge 1 commit into
Mathieu2301:mainfrom
russongit:main

Conversation

@russongit

Copy link
Copy Markdown

Summary

  • Fixes npm audit vulnerabilities in the esbuild/vite/vitest dependency chain by upgrading vitest to 4.1.9
  • Upgrading exposed a latent this-binding bug in src/miscRequests.js: searchMarket, searchMarketV3, and getUser's redirect recursion called this.getTA(...) / this.getUser(...), which only worked when these functions were invoked as object methods. Under vitest 4's ESM/CJS interop, tests import these via destructured named imports, so this no longer resolved correctly.
  • Replaced the three this.X(...) calls with module.exports.X(...), matching the pattern already used elsewhere in the same file (getIndicator, getChartToken calls).

Test plan

  • npm audit reports 0 vulnerabilities after the upgrade
  • Full test suite passes on vitest 4.1.9 (50 passed, 16 skipped, same as baseline on vitest 0.31.4)

Replace this.getTA/this.getUser calls with module.exports references in
searchMarket, searchMarketV3, and getUser's redirect recursion, matching
the pattern already used elsewhere in miscRequests.js. This was breaking
under vitest 4's ESM/CJS interop when functions were called via
destructured imports rather than as object methods.

Also bumps vitest to 4.1.9 (via npm audit fix --force), resolving the
remaining esbuild/vite/vitest vulnerability chain (0 vulnerabilities now).
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.

1 participant