Skip to content

Commit 501c45a

Browse files
fix(server): Simlock renewals no longer exceed the gateway's lease TTL cap
Renewals asked for a fixed ten-minute TTL, which a gateway with a lower lease.maxTtlMs refuses, so a watched lease expired after its first TTL. Renew without ttlMs so Simlock keeps the lease's own length (#35982). Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 426874c commit 501c45a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎apps/server/src/device/SimlockDeviceHost.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ const REQUEST_TIMEOUT = Duration.seconds(15);
4242
// The gateway queues a lease request for up to five minutes when every device is busy.
4343
const OPEN_TIMEOUT = Duration.minutes(7);
4444
const COMMAND_TIMEOUT = Duration.minutes(2);
45-
// Renewal keeps a watched but idle device; a lease this server stops renewing ends after LEASE_TTL.
45+
// Renewal keeps a watched but idle device. It sends no ttlMs: Simlock then keeps the lease's own
46+
// length, while one above the gateway's lease.maxTtlMs is refused rather than shortened.
4647
const RENEW_INTERVAL = Duration.minutes(2);
47-
const LEASE_TTL_MS = 10 * 60_000;
4848
const STREAM_PATH = /^\/vendor\/serve-sim\/helper\/([^/]+)\/stream\.avcc$/;
4949
const INPUT_PATH = "/vendor/serve-sim/helper/ws";
5050

@@ -422,7 +422,6 @@ export const make = Effect.fn("SimlockDeviceHost.make")(function* (
422422
lease.token,
423423
"POST",
424424
`/v1/leases/${encodeURIComponent(lease.leaseId)}/renew`,
425-
{ ttlMs: LEASE_TTL_MS },
426425
).pipe(Effect.result);
427426
if (renewed._tag === "Success") continue;
428427
const error = renewed.failure;

0 commit comments

Comments
 (0)