-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(server): speed up Windows diagnostics and editor discovery #3911
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?
Changes from all commits
99fe031
23ac856
f302154
ff0764b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,6 +117,17 @@ import * as RelayClient from "@t3tools/shared/relayClient"; | |
| const isOrchestrationDispatchCommandError = Schema.is(OrchestrationDispatchCommandError); | ||
|
|
||
| const nowIso = Effect.map(DateTime.now, DateTime.formatIso); | ||
| const EDITOR_DISCOVERY_TIMEOUT = Duration.seconds(5); | ||
| const EDITOR_DISCOVERY_FALLBACK = [] as const; | ||
|
|
||
| export const withEditorDiscoveryTimeout = <A, E, R>( | ||
| discovery: Effect.Effect<ReadonlyArray<A>, E, R>, | ||
| timeout: Duration.Input = EDITOR_DISCOVERY_TIMEOUT, | ||
| ) => | ||
| discovery.pipe( | ||
| Effect.timeoutOption(timeout), | ||
| Effect.map(Option.getOrElse(() => EDITOR_DISCOVERY_FALLBACK)), | ||
| ); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty editors stick after timeoutMedium Severity
Additional Locations (2)Reviewed by Cursor Bugbot for commit ff0764b. Configure here. |
||
|
|
||
| function unexpectedCompatibilityError(error: never): never { | ||
| throw new Error(`Unhandled compatibility error: ${String(error)}`); | ||
|
|
@@ -923,7 +934,9 @@ const makeWsRpcLayer = ( | |
| keybindings: keybindingsConfig.keybindings, | ||
| issues: keybindingsConfig.issues, | ||
| providers, | ||
| availableEditors: yield* externalLauncher.resolveAvailableEditors(), | ||
| availableEditors: yield* withEditorDiscoveryTimeout( | ||
| externalLauncher.resolveAvailableEditors(), | ||
| ), | ||
| observability: { | ||
| logsDirectoryPath: config.logsDir, | ||
| localTracingEnabled: true, | ||
|
|
||


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.
Windows timeout cannot interrupt discovery
Medium Severity
Windows
buildAvailableEditorsresolves every editor with synchronousSpawnExecutableResolutionPATH/statSyncwork inside a singleflatMap, with no Effect yield points.withEditorDiscoveryTimeouttherefore cannot fire while that work runs, soserver.getConfigcan still block past five seconds on the platform #3610 targets.Additional Locations (1)
apps/server/src/ws.ts#L936-L939Reviewed by Cursor Bugbot for commit ff0764b. Configure here.