Repository navigation
fix: stop the 401 when a log's path contains a percent sign - #1283
Draft
lukecotter wants to merge 1 commit into
Draft
lukecotter wants to merge 1 commit into
lukecotter wants to merge 1 commit into
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
This branch has not been deployed
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
A log in a folder whose name holds a literal
%xx, such asEnterprise%20Salesforce, would not open. The viewer showed "Could not read log: 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.This branch sends every webview URI fully encoded. In VS Code Web, the same log failed before this change and opens after it. A folder with a real space opens on both builds, which is why earlier repro attempts with spaces passed.
🛠️ Changes made
toString(), nottoString(true)). This is the Error Could not read log when opening log file #752 fix.%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.%20reaches the webview unchanged. It fails on the old code.🧩 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: 402 passed.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.📚 Docs updated?
🧪badge — see RELEASING.md)Anything else we need to know? [optional]
A later comment on #752 reports the same 401 when a WSL window opens a log stored on Windows. That case is not confirmed to have this cause yet. It needs the reporter's file path.