Repository navigation
fix(desktop): a failed t3 launcher install no longer leaves temp files in its bin folder #31910
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -148,8 +148,12 @@ export const install = Effect.gen(function* () { | |
| if (Option.getOrUndefined(existing) !== content) { | ||
| yield* fs.makeDirectory(path.dirname(shimPath), { recursive: true }); | ||
| const staging = `${shimPath}.${process.pid}.tmp`; | ||
| yield* fs.writeFileString(staging, content, { mode: 0o755 }); | ||
| yield* fs.rename(staging, shimPath); | ||
| yield* fs | ||
| .writeFileString(staging, content, { mode: 0o755 }) | ||
| .pipe( | ||
| Effect.andThen(fs.rename(staging, shimPath)), | ||
| Effect.ensuring(fs.remove(staging, { force: true }).pipe(Effect.ignore)), | ||
|
spoukyii marked this conversation as resolved.
Resolved
Contributor
Author
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. Thanks for the review. I'm keeping this one out of scope, for the same reason as the CodeRabbit thread above. Two installs in one process already share |
||
| ); | ||
| yield* logInfo("installed t3 launcher", { shimPath }); | ||
| } | ||
| return Option.some(shimPath); | ||
|
|
||
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.
This tests staging cleanup through the command wrapper, although
DesktopCliShim.installis the lower layer that fails on main. Could you move this case to the shim tests and exerciseinstalldirectly?Posted via Macroscope — Test Signal
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.
Leaving it in
DesktopCliCommand.test.ts.DesktopCliShim.installneeds the desktop environment, filesystem and path services.DesktopCliShim.test.tshas no Effect harness for those; it only renders the launcher and runs it in a shell.commandInin this file already builds those layers, and this file's existing install-failure case lives here too.command.installreachesDesktopCliShim.installwith nothing in between that touches the staging file, so this case fails onmainfor the shim's reason. Moving it would mean copying that harness into the shim tests for one case.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.
Sorry, I'm unable to act on this request because you do not have permissions within this repository.