Repository navigation
fix: ignore an invalid cached version in the update check - #3392
Merged
samiyac merged 1 commit intoNov 10, 2026
Merged
Conversation
samiyac
requested changes
Nov 4, 2026
|
El El lun, 9 nov. 2026 a la(s) 10:38, Samiya Caur ***@***.***>
escribió:
… ***@***.**** commented on this pull request.
------------------------------
In tests/utils/check-for-updates.test.ts
<#3392 (comment)>
:
> + throw new Error(`File not found: ${filePath}`);
+ });
+ const warnStub = sinon.stub(console, 'warn');
+ const unrefSpy = sinon.spy();
+ const spawnStub = sinon.stub(child_process, 'spawn').returns({
+ unref: unrefSpy,
+ } as unknown as child_process.ChildProcess);
+
+ await checkForUpdates('Run `npm update` to update.');
+
+ sinon.assert.notCalled(warnStub);
+ sinon.assert.calledOnce(spawnStub);
+ sinon.assert.calledOnce(unrefSpy);
+ });
+
+ it('ignores a cached version that is not a string', async () => {
Please squash the changes
—
Reply to this email directly, view it on GitHub
<#3392?email_source=notifications&email_token=CS77BODRMKND4EFU42K52AD5YHCETA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKOBSGY3DENJUGM3KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussion_r4513319811>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/CS77BODY2HNHUZJBGH2HOJT5YHCETAVCNFSNUABGKJSXA33TNF2G64TZHMYTANJUG44TGNZSGY5US43TOVSTWNRRGU2DENRQHE2DRILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/CS77BOGLZJRPX4VHZTGMQ7D5YHCETA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKOBSGY3DENJUGM3KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/CS77BOARELHSLA2P7AFSBRL5YHCETA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKOBSGY3DENJUGM3KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***
.com>
|
Contributor
Author
|
Squashed the follow-up into a single signed commit as requested. |
An invalid or non-semver value in the update-check cache previously made checkForUpdates throw. Treat that cache entry as a miss instead.
kevin9327
force-pushed
the
fix/update-check-invalid-cache
branch
from
November 9, 2026 22:00
443c3c9 to
8f1cd78
Compare
samiyac
enabled auto-merge
November 10, 2026 10:17
samiyac
approved these changes
Nov 10, 2026
Lightning00Blade
pushed a commit
to jaeminbird/chrome-devtools-mcp
that referenced
this pull request
Nov 11, 2026
🤖 I have created a release *beep* *boop* --- ## [1.13.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v1.12.0...chrome-devtools-mcp-v1.13.0) (2026-11-11) ### 🎉 Features * add logpoints built on the DevTools BreakpointManager ([ChromeDevTools#3211](ChromeDevTools#3211)) ([0877ee0](ChromeDevTools@0877ee0)) * add page-scoped network mocks ([ChromeDevTools#3384](ChromeDevTools#3384)) ([1d692d3](ChromeDevTools@1d692d3)) * support upstream network mock responses ([ChromeDevTools#3420](ChromeDevTools#3420)) ([c4bf342](ChromeDevTools@c4bf342)) ### 🛠️ Fixes * **config:** accept config files with a UTF-8 BOM ([ChromeDevTools#3365](ChromeDevTools#3365)) ([63170b1](ChromeDevTools@63170b1)) * **console:** stop resolving a cyclic Error.cause chain after 10 causes ([ChromeDevTools#3338](ChromeDevTools#3338)) ([172656a](ChromeDevTools@172656a)) * disable set_logpoints when --no-javascript-evaluation is set ([ChromeDevTools#3415](ChromeDevTools#3415)) ([11fcc59](ChromeDevTools@11fcc59)), closes [ChromeDevTools#3414](ChromeDevTools#3414) * **extensions:** say list_extensions only lists unpacked extensions ([ChromeDevTools#3433](ChromeDevTools#3433)) ([1383bb9](ChromeDevTools@1383bb9)) * ignore an invalid cached version in the update check ([ChromeDevTools#3392](ChromeDevTools#3392)) ([3a9f378](ChromeDevTools@3a9f378)) * **input:** validate press_key and submitKey parameters in Zod schema ([ChromeDevTools#3382](ChromeDevTools#3382)) ([375a269](ChromeDevTools@375a269)) * **network:** start an empty request list for navigations without a request ([ChromeDevTools#3357](ChromeDevTools#3357)) ([b701776](ChromeDevTools@b701776)) * normalize non-Error values thrown by tool handlers ([ChromeDevTools#3068](ChromeDevTools#3068)) ([535a3dc](ChromeDevTools@535a3dc)) * **performance:** error when performance_stop_trace is called on a non-recording page ([ChromeDevTools#2971](ChromeDevTools#2971)) ([ChromeDevTools#3117](ChromeDevTools#3117)) ([1ab630a](ChromeDevTools@1ab630a)) * **plugin:** launch the Claude Code MCP server with npx --prefix ([ChromeDevTools#3353](ChromeDevTools#3353)) ([a24334d](ChromeDevTools@a24334d)) * preserve task serialization on request cancellation ([ChromeDevTools#3079](ChromeDevTools#3079)) ([03fd4e8](ChromeDevTools@03fd4e8)) * report page loads that keep the URL ([ChromeDevTools#3395](ChromeDevTools#3395)) ([3cc38bb](ChromeDevTools@3cc38bb)) * save binary request bodies byte for byte ([ChromeDevTools#3404](ChromeDevTools#3404)) ([e3eb901](ChromeDevTools@e3eb901)) * suggest --headless when Chrome cannot find an X server ([ChromeDevTools#3428](ChromeDevTools#3428)) ([8b0856a](ChromeDevTools@8b0856a)) * **url:** unwrap view-source: before all scheme checks in validateUrl ([ChromeDevTools#3335](ChromeDevTools#3335)) ([7275268](ChromeDevTools@7275268)) * **wait:** explain whitespace-sensitive text matching ([ChromeDevTools#3350](ChromeDevTools#3350)) ([81a0379](ChromeDevTools@81a0379)) ### 📄 Documentation * add Pi client configuration ([ChromeDevTools#3364](ChromeDevTools#3364)) ([bc0d93e](ChromeDevTools@bc0d93e)) * clarify custom browser launch and connection options ([ChromeDevTools#3386](ChromeDevTools#3386)) ([7e10c08](ChromeDevTools@7e10c08)) * **input:** note that press_key cannot drive native <select> popups on macOS ([ChromeDevTools#3288](ChromeDevTools#3288)) ([8e79bd0](ChromeDevTools@8e79bd0)) ### ⚡ Performance * **memory:** drop async parents of request initiators in NetworkCollector ([ChromeDevTools#3345](ChromeDevTools#3345)) ([ca6f834](ChromeDevTools@ca6f834)), closes [ChromeDevTools#3344](ChromeDevTools#3344) ### 🏗️ Refactor * re-export only used Zod runtime members from third_party barrel ([ChromeDevTools#3439](ChromeDevTools#3439)) ([6b056c8](ChromeDevTools@6b056c8)) * reuse Zod schemas and validate integer viewport dimensions ([ChromeDevTools#3367](ChromeDevTools#3367)) ([3c609da](ChromeDevTools@3c609da)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Alex Rudenko <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
checkForUpdatesreads~/.cache/chrome-devtools-mcp/latest.jsonand passes itsversionstraight tosemver.lt. If that value is not a valid semver string (a hand-edited or otherwise corrupted file, e.g.{"version":"not-a-version"}or{"version":99}),semver.ltthrowsTypeError: Invalid Version. The throw happens before the mtime refresh and before the background re-fetch are started, so the bad file is never replaced: every start rejects on the same file until the user deletes it. Bothchrome-devtools-mcp-main.tsandchrome-devtools.tscall it with a top-levelawait.Repro against the built module, with that file in a temp
HOME:Fix
Only use the cached value when it is a string that
semver.validaccepts; otherwise treat the cache as having no version, so the normal 24h refresh replaces it.check-latest-version.tsalready only writes string versions, so valid caches behave exactly as before.Testing
tests/utils/check-for-updates.test.ts(invalid semver string with a stale cache: no warning, refresh spawned; non-string version: no warning). Both fail on main withTypeError, all 8 cases pass with the fix.eslintandprettier --checkclean on the changed files.AI-assisted (Grok)