Skip to content

Close the remaining session-touch paths after #4944: attempt lock, journal aliases, script publication, double teardown #4949

Open

Description

@thymikee

#4944 checks the session lease id before a request touches a leased session. Reviews of #4944 found four paths that the PR leaves open. Each one existed before #4944. The maintainer scoped #4944 to stop at its invariant.

Open paths

  1. Replay test attempts. A test suite authorizes the attempt session, then calls cleanup, record and capture directly. open from another client can attach a lease to the same session lifetime while those calls await. Rule: hold the attempt session lock across the authorization and the operation (packages/daemon/src/sessions/handlers/session-replay-command.ts, session-replay-video-owner.ts). The handler chain has no session-lock seam today.
  2. Journal path aliases. The guard that stops a request from writing or reading a leased session's journal compares addresses by string. On a case-insensitive volume, two addresses that differ only in case share one directory (packages/daemon/src/sessions/request-admission.ts, packages/daemon/src/core/session-store.ts). Rule: compare the resolved directory, or make journal paths injective per address.
  3. Script publication. A successful doctor, or any request whose finalization runs after its locks release, can publish a recording that a concurrent owner changed. Rule: recheck the credential and the exact session lifetime immediately before publication, including the lifetime that the request's own open created (packages/daemon/src/core/session-script-publication-capability.ts, packages/daemon/src/server/request-router.ts).
  4. Double teardown. When the lease holder's request ends its expired session inline, the lease-end owner also tears that session down in the same lock context.

Found in the reviews of #4944.

Activity

  1. apex-sentinel-staging commented on Nov 22, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: bug

    The report identifies four concrete pre-existing concurrency, path-aliasing, publication, and teardown gaps left after PR #​4944 and points to specific files/handlers, which describes incorrect or unsafe existing behavior rather than a new feature or support question.

    Required sections

    • Steps to reproduce (missing)
    • Expected and actual behavior (missing)
    • Version or environment (missing)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions