Skip to content

test(daemon): expect the lease-id refusal for a no-id shutdown on a leased session address - #4943

Closed
thymikee wants to merge 1 commit into
0.22from
fix/0.22-shutdown-test-skew
Closed

thymikee wants to merge 1 commit into
0.22from
fix/0.22-shutdown-test-skew

Conversation

@thymikee

@thymikee thymikee commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

0.22 Coverage is red since #4917 merged on top of #4911 (run 44996420221). A #4917 test expected DEVICE_IN_USE without a session name for a no-lease-id shutdown on a leased session's own address. With #4911 in the base, the shared lease check refuses that request first with UNAUTHORIZED LEASE_SESSION_MISMATCH (field leaseId). That is the intended, stricter rule.

The looped test becomes two tests: with the lease id, DEVICE_IN_USE names the session; without it, the refusal is UNAUTHORIZED and does not name the session. Test-only; no production change. No scope expansion.

Validation

…eased session address

#4911 refuses a request without the lease id at the shared lease check, before
shutdown reaches its DEVICE_IN_USE device check. The #4917 test still expected
DEVICE_IN_USE without a session name, so 0.22 Coverage is red after both merged.
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.08 MB 6.08 MB 0 B
Package (unpacked) 6.08 MB 6.08 MB 0 B
Package (download) 1.86 MB 1.86 MB +15 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.6 ms 20.6 ms +0.0 ms
CLI --help 42.4 ms 38.7 ms -3.8 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of a192a07

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (b03e32bf7a36).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at a192a07, and there are no conflicts. The only failures are three cancelled PR-body check jobs, which look like superseded runs, and the diff touches no body-check route. Not verified here: the session-shutdown test run itself and the exact point in the session command handler where shutdown is refused; both were traced from the test harness and the PR body. Not blocking, and fine to take or leave: #4941 edits the same loop in the same file for the same Coverage failure, so whichever merges second will conflict and only one of the two should land; and the JSON.stringify(refusal) check at https://github.com/callstack/agent-device/blob/a192a07/packages/daemon/src/sessions/handlers/__tests__/session-shutdown.test.ts#L175 skips an error's message, so it could miss a session name there. Asserting on refusal.message too would cover that.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 22, 2026
@thymikee

Copy link
Copy Markdown
Member Author

Superseded by #4941, which landed the same test fix on 0.22.

@thymikee thymikee closed this Nov 22, 2026
@thymikee
thymikee deleted the fix/0.22-shutdown-test-skew branch November 22, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant