Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

ci(windows-signing): exp backoff + jitter, 5 attempts to survive SSL.com outages

Louis Beaumont00c57acae793
diff --git a/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1 b/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1
index 1a22bef77..a379b9a86 100644
--- a/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1
+++ b/apps/screenpipe-app-tauri/src-tauri/sign-ssl.ps1
@@ -57,23 +57,34 @@ New-Item -ItemType Directory -Force -Path $signedDir | Out-Null
Write-Host "Signing binary: $FilePath"
-# Retry with backoff to ride out transient SSL.com / CSC API hiccups.
-# Symptom we hit on v2.4.41 (2026-04-23, build 24861271810): CodeSignTool
-# threw `Unexpected character (<) at position 0` from CscApi.isOtpTypeOnline
-# / getCredentialInfo because the SSL.com endpoint returned an HTML
-# error/challenge page instead of JSON. Same workflow had succeeded 42 min
-# earlier with no code changes — purely SSL-side. A 25-minute Windows build
-# shouldn't die because of a brief upstream blip; retry the sign call.
+# Retry with exponential backoff + jitter to ride out transient SSL.com / CSC
+# API hiccups. Symptoms we've hit (recurring):
+# - v2.4.41 (2026-04-23, build 24861271810)
+# - v2.4.258 (2026-05-22, build 26291170628) — both Windows x64 + ARM64
+# CodeSignTool throws `Unexpected character (<) at position 0` from
+# CscApi.isOtpTypeOnline / getCredentialInfo because the SSL.com endpoint
+# returned an HTML error/challenge page instead of JSON. Adjacent workflow
+# runs succeed with no code change — purely SSL-side outages.
+#
+# 3 attempts with 30/60s backoff (total 90s) wasn't enough for v2.4.258.
+# Going to 5 attempts with exponential backoff (30/60/120/240s + jitter,
+# total up to ~7.5 min) so SSL outages longer than a minute stop killing
+# 25-min Windows builds. If SSL is down longer than that, fail loudly —
+# we'd rather see it than burn cycles indefinitely.
$fileName = Split-Path $FilePath -Leaf
$signedFile = Join-Path $signedDir $fileName
-$maxAttempts = 3
+$maxAttempts = 5
$attempt = 0
$signed = $false
while (-not $signed -and $attempt -lt $maxAttempts) {
$attempt += 1
if ($attempt -gt 1) {
- $backoffSec = 30 * ($attempt - 1)
+ # Exponential backoff: 30s, 60s, 120s, 240s — plus 0-15s jitter so
+ # parallel signing calls don't thundering-herd the same SSL endpoint.
+ $base = 30 * [math]::Pow(2, $attempt - 2)
+ $jitter = Get-Random -Minimum 0 -Maximum 15
+ $backoffSec = [int]($base + $jitter)
Write-Host "Sign attempt $attempt/$maxAttempts after ${backoffSec}s backoff..."
Start-Sleep -Seconds $backoffSec
if (Test-Path $signedDir) { Remove-Item $signedDir -Recurse -Force }