Repository navigation
fix(vscode-activity): keep the activity reporter running in Restricted Mode - #257
Draft
viniciusdc wants to merge 1 commit into
Draft
viniciusdc wants to merge 1 commit into
viniciusdc wants to merge 1 commit into
Conversation
…d Mode code-server opens the user's home in Restricted Mode until they trust it, and VS Code disables any extension that doesn't declare untrusted-workspace support. With the reporter disabled but the /vscode/ proxy opt-out still in place, VS Code traffic stopped counting as activity while nothing reported real interaction, so users actively working in VS Code were idle-culled. Declare capabilities.untrustedWorkspaces.supported (the extension only reads editor events and makes one local HTTP request) and bump it to 0.1.1. Also count only window-state transitions into focused/active. The event fires on blur and when the window goes inactive too, and counting those extended idle sessions by up to one timeout. Add a unit test pinning the capability.
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.
Closes #256.
The activity reporter from #226 was disabled in VS Code's default Restricted Mode, so users who never clicked Trust got idle-culled while typing (repro in #256). This declares untrusted-workspace support so the reporter runs regardless of trust.
package.json: addcapabilities.untrustedWorkspaces.supported: trueand bump the extension to 0.1.1. The extension only listens to editor events and makes one local HTTP request, so it's safe to run untrusted.extension.js: only count window-state changes into focused/active. Blur and going inactive were also counted as activity, which pushed an idle cull back by up to one timeout.Not in this PR: gating the proxy opt-out on an activation marker written by
activate()instead of on the install directory (the second half of #256). That one needs a decision on first-spawn behavior, so I'd rather do it separately.Testing
pytest tests/unit: 182 passed. The new test fails against the manifest onmain.node --checkonextension.js, andbuild-vsix.pypackages the new manifest (version 0.1.1, capability present).last_activitymoving pastshutdownNoActivityTimeout, and the extension host log should shownebari.nebari-activity-reporteractivating without trust).