Repository navigation
fix: open logs with a % in the path, or opened from a remote window - #1283
Merged
lcottercertinia merged 6 commits intoNov 13, 2026
Merged
Conversation
The webview got the log URI with its percent signs left unencoded, so a folder named Enterprise%20Salesforce was read as "Enterprise Salesforce". That path is outside the panel's resource roots, so the fetch failed with "Error reading log file: 401". The viewer's script and stylesheet URIs had the same defect, so an install path with a literal %xx would leave the panel blank. They are encoded too. Fixes certinia#752
In a WSL, SSH or container window, a log on the client machine has a `vscode-local` URI. The webview cannot fetch that scheme, so the extension reads the log and sends the text in the message.
An empty body was read as "no body", so the webview fetched the URI it cannot read. The webview now uses the body whenever the message has one.
The remote window fix had no test for an empty log, a failed read, or a body the caller supplied. The percent fix had no test for the script and stylesheet URIs.
The entry named only file paths and the 401. A user who opens a local log from a remote window would not recognise it.
lukecotter
marked this pull request as ready for review
November 13, 2026 12:33
The log was decoded to a string in the extension host and copied to the webview. It now goes as a Uint8Array, which VS Code transfers as binary and the parser reads directly.
lcottercertinia
approved these changes
Nov 13, 2026
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.
📝 PR Overview
Two separate causes gave "Could not read log" in #752. This branch fixes both.
A
%in the path. A log in a folder whose name holds a literal%xx, such asEnterprise%20Salesforce, would not open. The viewer showed "Error reading log file: 401". The extension sent the webview the log URI with its%left unencoded. The webview then read%20as a space and asked for a path outside the panel's resource roots.A local log opened from a remote window. In a WSL, SSH or dev container window, a log stored on the client machine has a
vscode-local:URI.asWebviewUriputs that scheme into the URL as it is, but VS Code translates the panel's resource roots tofile:on the client side. The schemes do not match, so the request is refused. The reporter saw a 401 on WSL. A dev container on macOS gives a 404.🛠️ Changes made
toString(), nottoString(true)).%xxwould leave the panel blank.asWebviewUristub keep the URI's encoding. The old stub rebuilt the URI from its decoded path, which hid this bug.vscode-locallog, read the file in the extension host and send it in the existinglogDatafield of thefetchLogmessage. The webview already preferslogDatato the fetch. Every other scheme still goes through the fetch.Uint8Array, not a string. This is the one change to the message contract:logDatais nowstring | Uint8Array. VS Code transfers a plainUint8Arrayas binary, and the parser reads it directly. The file read returns a NodeBuffer, which VS Code would post as a JSON array of numbers, so the host wraps it in a plainUint8Arrayview first.🧩 Type of change (check all applicable)
📷 Screenshots / gifs / video [optional]
N/A
🔗 Related Issues
fixes #752
✅ Tests added?
Test plan:
pnpm exec jest --selectProjects lana log-viewer: 3345 passed.pnpm lint: clean.pnpm test:e2e:web: 2 passed.Enterprise%20Salesforce, open it, then run Log: Show Apex Log Analysis. On 1.24.0 it fails with the 401. On this branch the timeline renders.vscode-local+…URL. A VSIX built from this branch opens the log, and a log that holds only the log level line shows the empty states.📚 Docs updated?
🧪badge — see RELEASING.md)Anything else we need to know? [optional]
vscode-local+host as the reporter's.