authorgravatar for 75276669+Gigioxx@users.noreply.github.comGuillermo Casanova <75276669+Gigioxx@users.noreply.github.com> 2026-10-11 00:09:38-03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-11 00:09:38-03:00
log584af5af4526fea4ad623c7bad931ef97d2fdb17
tree2408b894023a069d278aeae0b41a7fe57306cf88
parent758d54a9bb713bbb881c9218ff74c53877b4a6c4
signature Signed by PGP key B5690EEEBB952194

fix(ssh): record the archive lock owner's real PID (#14598)


2 files changed, 8 insertions(+), 1 deletions(-)

packages/ssh/src/tunnel.test.ts+6
...@@ -232,6 +232,12 @@ describe("ssh tunnel scripts", () => {...@@ -232,6 +232,12 @@ describe("ssh tunnel scripts", () => {
232 assert.notInclude(script, "npx");232 assert.notInclude(script, "npx");
233 });233 });
234234
235 it("embeds the runner in the launch script byte for byte", () => {
236 const runner = buildRemoteT3RunnerScript(ARCHIVE);
237 assert.include(runner, 'printf \'%s\\n\' "$$" > "$T3_LOCK/pid.tmp"');
238 assert.include(buildRemoteLaunchScript(ARCHIVE), runner);
239 });
240
235 it("uses the remote t3 runner for launch and pairing scripts", () => {241 it("uses the remote t3 runner for launch and pairing scripts", () => {
236 const stateKey = "711bc738002d72fd";242 const stateKey = "711bc738002d72fd";
237 const launch = SshTunnel.buildRemoteLaunchScript(ARCHIVE);243 const launch = SshTunnel.buildRemoteLaunchScript(ARCHIVE);
packages/ssh/src/tunnel.ts+2-1
...@@ -240,7 +240,8 @@ function applyScriptPlaceholders(...@@ -240,7 +240,8 @@ function applyScriptPlaceholders(
240): string {240): string {
241 let result = template;241 let result = template;
242 for (const [token, value] of Object.entries(replacements)) {242 for (const [token, value] of Object.entries(replacements)) {
243 result = result.replaceAll(`@@${token}@@`, value);243 // A replacer function keeps `$$` and other `$` patterns in the value literal.
244 result = result.replaceAll(`@@${token}@@`, () => value);
244 }245 }
245 return result;246 return result;
246}247}