resume
Attempt to resume this room from a ResumeToken after a transport drop.
Wired via us.tractat.kuilt.session.partition.JoinerReconnectController (1D).
Returns a ResumeResult.JoinerOutcome, never the whole ResumeResult hierarchy: the host's own verdicts (ResumeResult.WindowNotYetOpen, ResumeResult.TokenInvalid) do not travel as values — they arrive as the us.tractat.kuilt.session.admit.RejectCode on ResumeResult.Refused (#2364). Branching on a value this surface cannot return is therefore a compile error rather than a dead arm.
Samples
// After the admit handshake the joiner holds a reconnect credential — save it.
val token: ResumeToken = room.resumeToken ?: return false
// ... transport drops; you redial the fabric and rebuild the room ...
// Present the saved token to re-enter within the leader's grace window.
return when (val outcome = room.resume(token)) {
ResumeResult.Success -> false // back in the room; state resync follows
// The host answered, and said no. WHY is in the code, never in the message: an elapsed
// window and a token for another room are terminal, a window the host has not opened
// yet is not. See classifyRejectCodeSample.
is ResumeResult.Refused -> outcome.code.retryable
ResumeResult.TimedOut -> true // no reply within resumeTimeout — the host is unreachable now
// We never asked: this room is already over (left, or the host was lost), or the frame
// could not be sent. Re-join fresh.
ResumeResult.WindowClosed -> false
}Content copied to clipboard