-
Notifications
You must be signed in to change notification settings - Fork 37.8k
Fix URI scheme error in LoggerChannelClient.deregisterLogger #294001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
LoggerChannelClient.deregisterLogger accepted only URI but the base interface accepts URI | string. Callers passing string logger IDs (e.g. mcpServer) sent raw strings over IPC, causing URI.revive to treat the string as a scheme and fail validation. Fix: accept URI | string and convert via toResource() before IPC, matching the pattern already used by setVisibility. Also enrich the _validateUri error message with the actual scheme value for future telemetry diagnosis.
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @jriekenMatched files:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Fixes a high-volume unhandled error caused by LoggerChannelClient.deregisterLogger sending string logger IDs over IPC (where the main process attempted URI.revive(string) and failed URI validation). Also improves URI validation diagnostics and adds internal guidance for handling telemetry-driven error fixes.
Changes:
- Widen
LoggerChannelClient.deregisterLoggerto acceptURI | stringand serialize viatoResource(...)before IPC. - Enrich
_validateUri’s “illegal scheme” error to include the invalid scheme value (truncated) and its length. - Add internal skill/prompt docs for investigating and fixing telemetry-reported unhandled errors.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/platform/log/common/logIpc.ts | Fixes producer-side IPC payload for deregisterLogger by converting string IDs to a log file URI first. |
| src/vs/base/common/uri.ts | Adds more diagnostic detail to URI scheme validation errors to aid future telemetry triage. |
| .github/skills/fix-errors/SKILL.md | Adds internal guidelines for addressing unhandled error telemetry issues. |
| .github/prompts/fix-error.prompt.md | Adds an agent prompt for the “fix unhandled error from telemetry” workflow. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…al characters and total count
Fixes #293503
Problem
LoggerChannelClient.deregisterLoggernarrowed its parameter type to onlyURI, but the base interfaceILoggerService.deregisterLoggeracceptsURI | string. Callers passing string logger IDs (e.g., MCP server passingthis._loggerId) sent raw strings over IPC. On the main process,URI.revive(stringValue)treated the entire string as a URI scheme, which failed_validateUriwith[UriError]: Scheme contains illegal characters.This was the #1 unhandled error by volume: 1.4M hits, 567K affected users.
Fix
Producer fix (
src/vs/platform/log/common/logIpc.ts): ChangedderegisterLoggerto acceptURI | stringand callthis.toResource(idOrResource)before sending over IPC — matching the pattern already used bysetVisibility.Error enrichment (
src/vs/base/common/uri.ts): Enhanced the_validateUrierror message to include the actual invalid scheme value (truncated to 50 chars) and its length, so future telemetry from any call site reveals what data was passed.