Skip to content

fix(host): leave the directory on its server, so the serving Mac sees a teammate leave and rejoin - #692

Merged
iamnbutler merged 3 commits into
mainfrom
fix-rejoin
Oct 23, 2026
Merged

iamnbutler merged 3 commits into
mainfrom
fix-rejoin

Conversation

@iamnbutler

Copy link
Copy Markdown
Contributor

A host that leaves or changes its directory now removes itself from the old one (DELETE /hosts/<name>, after any publish already under way to it). The directory a Mac serves calls back on that leave as well as on a first publish, so the serving Mac re-reads it right away. Before this, a host that left kept its row, so its rejoin didn't count as a first publish, and the serving Mac's Settings → Team never showed it leave or come back. services/directory gets the same DELETE and will have it once it's redeployed. Until then a leave there just logs directory.leave.failed.

Settings → Team also hides Left the directory. / Directory checked and joined. once the host's join state changes somewhere else, such as an ace directory <url> rejoin.

Map: ^901, ^115. Refs #686, #636.

Smoke test (two bun ace serve hosts from this lane on one Mac, isolated homes, ports 5160 and 5162, A serving):

  • Left B in the app. B logged directory.left, and A's open Settings → Team re-synced straight away (11:00:59 → 11:01:37) instead of waiting for its heartbeat.
  • Rejoined B with ace directory <url>. B's open Settings → Team dropped Left the directory. and shows the joined, synced row.
  • Not seen: A listing B as a separate row that leaves and comes back. Both hosts on one Mac share the machine name natembp, so the directory sees them as one row, and testing that needs a second Mac.

Built in Ace

No. Claude Code (a fix-train worker) wrote this from the shell and a headless Playwright browser, not in an Ace channel (#5).

… a teammate leave and rejoin

Why: apps/host/src/directory.ts#function configure | leaving or changing directories DELETEs this host from the old one, after any publish under way to it, or the serving Mac keeps the stale row and a rejoin never counts as a join
Why: apps/host/src/directory-server.ts#function handle | a host leaves only as its whois machine name, and leaving calls members so the serving host re-reads its own directory now
@iamnbutler
iamnbutler merged commit a890ec0 into main Oct 23, 2026
1 check passed
@iamnbutler
iamnbutler deleted the fix-rejoin branch October 23, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant