Repository navigation
Conversation
…device An allocation that repeats the leaseId of its live lease, for the same tenant, run, backend, provider, and client, now gets that lease back before a proxy daemon picks a device. A retry after a lost reply no longer fails when the leased device left the inventory, and no longer binds another device when the spec resolves differently. The registry owns the rule in renewRequestedLease, and allocateLease applies it too. The by-spec test helper now asserts that the reply carries a lease. Co-Authored-By: Claude <noreply@anthropic.com>
…nning unbound Every lease the CLI allocates names its device: a picking daemon binds the key, and a keyless lease from an older daemon is released and reallocated by the locally picked key. A renewed keyless lease was therefore supplied from outside, so open now refuses it with LEASE_SCOPE_MISMATCH and leaves it active, as the heartbeat refused it before by-spec allocation, rather than running on a device the lease does not bind. The heartbeat test fixture echoes the deviceKey the request names, as the daemon does. Co-Authored-By: Claude <noreply@anthropic.com>
…el guard Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Size Report
Startup median (7 runs, lower is better):
|
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
I found no new blocking problem in the code at 1067575, but the PR is not ready to merge. The Smoke Tests jobs are still queued or in progress and none has failed. Smoke runs device commands without a proxy lease, so it does not exercise the lease registry, the lease handler or the CLI proxy binding that this diff changes. There are no conflicts. Not blocking, and you can take or leave these: The merge step that remains is the open Cubic P1 thread on the issued-id fallback (#3619 (comment)). Please enforce one rule: an allocate that names an already-issued I did not run the new tests. I judged that they would fail on the old code by reading the pre-change paths. I also did not check the claim that refusing a keyless renewed lease "matches the behavior before #3487". #3487 shipped in v0.21.28, so this refusal changes behavior for released users. The docs are updated. Please check whether |
…SE, and every renewal keeps the host window
|
Both points are fixed in a1033ad.
I left the |
|
The code at a436b0a looks good to me, and it fixes the problems from the earlier review (#3619 (comment)). A retried allocation now returns its own lease. A renewed lease without a binding is refused. I did not run the new registry tests myself. I read the old code path, and the new tests should fail on it. I did not check whether MIN_LEASE_WINDOW_MS is at or below the 10_000 ttl that the host-window test passes to putHostLease. You report that the test passes, so I am taking that as given. The five cubic-dev-ai threads all look fixed at this head, so you can resolve them. The first is the issued-id check before refreshExistingRunBinding (https://github.com/callstack/agent-device/blob/a436b0a/packages/daemon/src/resources/lease-registry.ts#L85-L92), covered by the two-leases-one-run test: #3619 (comment). The second is the retry without ttlMs renewing with leaseOwnTtlMs: #3619 (comment). The third is the remote-proxy.md retry scope and the several-leases-per-run note: #3619 (comment). The fourth is the clock advance and the 91_000 expiresAt assertion in the lease-registry test: #3619 (comment). The fifth is the client-api.md scope-conditional retry text, which the last review confirmed and this delta does not touch: #3619 (comment). The two Smoke Tests failures look unrelated to this change. On Android, |
Follow-up to #3487, which merged before these review threads were answered.
DEVICE_NOT_FOUNDwhen the leased device had left the inventory, or withLEASE_ID_IN_USEwhen the spec now matched another device. The registry's newrenewRequestedLeaserefreshes the live lease when tenant, run, backend, provider and client match; the lease id is the retry key because one run can hold several leases.openon a renewed lease that names no device now fails withUNAUTHORIZED/LEASE_SCOPE_MISMATCHand never releases that lease. Only a lease supplied from outside can lack a device key; before this fixopenran on a locally picked device that lease did not bind. This matches the behavior before feat(proxy): allocate by device spec and bind the device the lease names #3487.isDeviceTargetinstead of a private copy.Docs:
remote-proxy.mdandclient-api.mddescribe the retry behavior and the refused keyless lease.Checks: build, typecheck, lint, layering, fallow, wire-compat (protocol unchanged), the eager-closure budgets, and the lease handler, registry, lease-scope, remote-connection and capture-kit envelope tests. Each new test fails without its fix.