relay-companion 0.1.237 → 0.1.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8467,6 +8467,7 @@
8467
8467
  function openThreadDetail(threadId, partyHint = "", source = "relays", options = {}) {
8468
8468
  if (activeView === "relays" && source === "relays" && scrollEl) relaysListScrollTop = scrollEl.scrollTop;
8469
8469
  dismissReactionPickers();
8470
+ threadDetailScrolledFor = null;
8470
8471
  threadsSource = source;
8471
8472
  threadsCameFrom = source;
8472
8473
  expandedMsgIds.clear();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relay-companion",
3
- "version": "0.1.237",
3
+ "version": "0.1.239",
4
4
  "description": "Companion CLI for Relay (sendrelays.com): pairs this machine with your Relay account so coding agents like Claude Code and Codex can send and receive Relay messages.",
5
5
  "homepage": "https://sendrelays.com",
6
6
  "repository": {
@@ -519,6 +519,9 @@ export function buildWindowsUpdateScript({
519
519
  // atomic, and fails when the directory already exists (= mkdir lock semantics).
520
520
  `try { $null = New-Item -ItemType Directory -Path $Lock -ErrorAction Stop } catch { Write-UpdateLog 'another update in progress; skipping'; exit 0 }`,
521
521
  `$KeepNew = $false`,
522
+ // Tracks whether we booted the pill out for the tree swap, so `finally` can put it
523
+ // back on EVERY exit path — the darwin cleanup trap does the same with PILL_STOPPED.
524
+ `$PillStopped = $false`,
522
525
  // PowerShell runs `finally` on normal completion, thrown errors, and `exit`,
523
526
  // covering the same paths as the darwin EXIT/INT/TERM trap.
524
527
  `try {`,
@@ -557,6 +560,7 @@ export function buildWindowsUpdateScript({
557
560
  ` Write-UpdateLog 'stopping pill for the tree swap'`,
558
561
  ` $null = Invoke-Native 'schtasks /End /TN "${WINDOWS_PILL_TASK_NAME}"'`,
559
562
  ` Stop-RelayServiceProcesses '${WINDOWS_PILL_TASK_NAME}'`,
563
+ ` $PillStopped = $true`,
560
564
  // The old daemon is node.exe running from OUTSIDE the tree (node's binary lives in
561
565
  // the prefix, and it holds no mapped images under $Pkg), so it does not block the
562
566
  // rename and is left alone here; it is stopped, by identity, at restart time.
@@ -671,6 +675,19 @@ export function buildWindowsUpdateScript({
671
675
  ` Write-UpdateLog 'update committed; pill and daemon restarted from the new tree'`,
672
676
  `} finally {`,
673
677
  ` if (-not $KeepNew) { Restore-Tree }`,
678
+ // The pill was booted out for the tree swap. Every abort between there and the
679
+ // restart step would otherwise leave the user with no pill until their next logon
680
+ // — the darwin cleanup trap re-ensures it the same way. Idempotent: the success
681
+ // path already restarted it, so this only acts when the pill is genuinely down.
682
+ ` if ($PillStopped -and (Get-RelayServiceProcesses '${WINDOWS_PILL_TASK_NAME}').Count -eq 0) {`,
683
+ ` if ((Invoke-Native ('schtasks /Query /TN "${WINDOWS_PILL_TASK_NAME}"')) -eq 0) {`,
684
+ ` $null = Invoke-Native 'schtasks /Run /TN "${WINDOWS_PILL_TASK_NAME}"'`,
685
+ ` if (Wait-RelayServiceAlive '${WINDOWS_PILL_TASK_NAME}' 10) { Write-UpdateLog 'pill brought back after an aborted update' }`,
686
+ ` else { Write-UpdateLog 'pill did not come back after an aborted update; it will start at next logon' }`,
687
+ ` } else {`,
688
+ ` Write-UpdateLog 'pill task is missing, so the pill stays down; run "relay repair-desktop" to re-register it'`,
689
+ ` }`,
690
+ ` }`,
674
691
  ` Remove-Item -LiteralPath $Lock -Recurse -Force -ErrorAction SilentlyContinue`,
675
692
  `}`,
676
693
  ];