Farewell

@Serializable
@SerialName(value = "farewell")
data class Farewell(val peerId: String, val expired: Boolean = false, val supersededBy: String? = null) : AdmitMessage

Sent by the host to every remaining member when a member departs cleanly (the host received that member's Goodbye).

The host is the membership authority — it admits via Welcome; this is the eviction counterpart. On receipt each member removes the departed peer promptly with us.tractat.kuilt.session.LeaveReason.Normal, instead of waiting out its own heartbeat window and mislabelling the clean leave as us.tractat.kuilt.session.LeaveReason.PartitionExpired.

Host-authoritative, not peer-trust: receivers act on a Farewell only when it comes from their identified host — never on another joiner's raw Goodbye (a spoof surface, and hub/relay topologies may lack direct joiner↔joiner edges).

peerId — the departed member's us.tractat.kuilt.core.PeerId value.

expired — false (the default) for a clean Goodbye-driven departure, evicted with us.tractat.kuilt.session.LeaveReason.Normal; true when the host is propagating a reconnect-window expiry, evicted with us.tractat.kuilt.session.LeaveReason.PartitionExpired. Expiry needs the same authoritative fan-out as a clean leave — on a star topology a joiner has no heartbeat against another joiner, so without it an expired seat is never evicted from a peer joiner's roster (#1557). Defaulted so it is wire-safe: a frame from an older build that never sends the field decodes as a clean leave, which is what that build meant.

supersededBy — set when the departed member's held seat was taken over by the same device under a new peer id (v6, #3159): the us.tractat.kuilt.core.PeerId value of the member that took it. A member evicts with us.tractat.kuilt.session.LeaveReason.Superseded naming it, and the roster Welcome for that member follows on the same lane. The host also sends this Farewell directly to the superseded member, which then ends its room and never says Hello again. null on every other Farewell.

A Hello from a superseded id under the key that was superseded is not answered with this Farewell but with a Reject naming that Hello, under RejectCode.Superseded (v7, Decided 32): a joiner honours a Farewell only from its identified host, and a new process of the device reusing the old id has none yet.

Wire-compatible: an older build that doesn't know this message drops it as malformed and degrades to its own heartbeat-window eviction (the prior behavior).

Constructors

Link copied to clipboard
constructor(peerId: String, expired: Boolean = false, supersededBy: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard