Erasing a private session on the daemon erases it at the plane first, as an erasure started there goes, and erases nothing where the plane cannot be asked; a sealer whose report the plane refuses as stale stops¶
Decision 789 · accepted · 2026-10-05 · issue #432
- The plane first.
Private.erase/2asks the plane'ssession.erase, which destroys the key itself (756). Once it has, the daemon does for this one session whatapply_erasures/1does for an erasure started elsewhere: the sealer stops, the copy here goes, andsession.erasedtells the plane, which deletes every version under the prefix; one the plane could not be told about it names at the next link. The answer iserased: true, state: "erased". The plane is asked before the sealer stops, so a refusal changes nothing; the sealer's last seal on its way down is then refused by the plane, and whatever got through before is under the prefix it deletes. erasure_pendinguntil the key is gone. Where the key manager refused, the answer iserased: false, state: "erasure_pending"; the sealer and the session stop, the copy here stays and is listedsync: "erasure_pending", and it goes with the key: at the next link, whosesession.erasuresthe plane answers after trying the key again, or at the nextsession.erase. Kept rather than dropped at once, because the listing is where a person sees that an erasure did not finish, and because 756 has a device's copy go after the key, as the objects do.- Nothing erased where the plane cannot be asked. The slot allowed either erasing
the copy here and saying what remained, or refusing; this refuses, as the issue put
it:
unavailablewithreason: "unlinked"(no token),"not_owner"(below), or why the plane did not answer, andplane_url, the plane the daemon was last linked to, where the session is sealed and can be erased. Erasing only this copy would leave the key and the sealed copy, restorable on another device, and drop the index entryresume/1andapply_erasures/1work from, so nothing on this machine would ever finish it. Refusing loses nothing: the copy is on the person's disk, and every signed-in client links the daemon on its own (764). What it costs: a private session on a daemon nobody links again cannot be erased through Troupe. One the plane has no row for (not_foundwithoutreason: "erased") was never sealed, and is erased here. - Only with the owner's token. A session whose
owner(784) is not the person linked is refusednot_ownerbefore anything is asked, asresume/1leaves it alone: the plane is asked nothing about it with somebody else's token. - One shape. A local session's answer gains
state: "erased"too. - A stale report stops the sealer.
Sealernow takes it as the fence it is: it seals nothing more, not even interminate/2, and stops with{:shutdown, :stale_version};seal_now/2answers{:error, :stale_version}. The daemon's sealers arerestart: :transient, so a crash still restarts one and this does not; they were:permanent, and a stopped one would have been started again from its first options, at the old epoch. The session stayselsewhere(785) until it is claimed here, andPrivate.stop/1allows for a sealer that stopped between the lookup and its last seal.
Governs: apps/troupe_gateway/lib/troupe/gateway/private.ex