Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: 01M4YVZ6KGNQ7MFS1RP81MQCE0
anchor: function handle
created: 2026-10-15T04:08:49Z
norm: '1'
sig: e597b5fbc8e664ce
body_hash: 5fbfe53cca188a52
raw_hash: 71f944ae5bee3fdd
lines: 266-519
---

a hosted channel's location must stay known from the peer's last listing when there is no directory; otherwise hosting doesn't survive the owner's Mac going away
5 changes: 4 additions & 1 deletion apps/host/src/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,11 @@ async function handle(
return target.request(forwarded, watch, trace);
}
const machine = !client.peer && peers.find(request.channel);
// A hosted channel outlives its host's reachability: the directory or that host's last listing says where it runs.
const hosted = !client.peer && !machine
&& directory.read().channels.find((value) => value.id === request.channel && value.hosted);
&& [...directory.read().channels, ...peers.unreachable()].find((value) =>
value.id === request.channel && value.hosted
);
if (hosted) {
if (request.request.op === "kill" && client.user !== hosted.owner) {
throw new Error("Only the channel's owner can kill it");
Expand Down