You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
core: a concurrent human lease claim can read a partly written lease as stale #298
createExclusiveHumanLeaseFile in packages/core/src/takeover.ts creates the lease file with a wx open and writes its content in the same writeFile call, which is two kernel steps. A peer whose own wx open fails can read the file between those steps and get an empty string. parseHumanLease("") returns undefined, so the peer throws StaleHumanLeaseError for a lease that is live and being written. Under Bun the window is microseconds, and the takeover test in PR #289 starts both claims at the same instant.
In the desktop product path, startHumanTakeover runs under withSessionVncLock, so two takeovers of one session do not race there. Other callers of acquireHumanLease have no such lock.
Publish the lease by writing a temp file and linking it into place, as publishCoordinationIdentity does, so a peer never sees a partial lease
Add a test that a peer never reads a partial lease
Activity
test(core): report the raw lease when a takeover loser sees a stale l…