Reject

@Serializable
@SerialName(value = "reject")
data class Reject(val reason: String, val codeId: String? = null, val answers: ByteArray? = null, val supersededBy: String? = null, val retryable: Boolean? = null) : AdmitMessage

Sent by the host to refuse a joiner's Hello, at the Hello gate or once its Proof was checked.

reason is a human-readable rejection cause for debugging; code is its structured counterpart, which is what a consumer should branch on (#1572).

codeId is the wire form of code: nullable and defaulted, so a Reject carrying no code decodes as RejectCode.Unspecified, which is retryable.

answers — the Hello.joinerNonce of the Hello this refuses (v7, #3215). A joiner acts on a Reject only when this equals the nonce of the latest Hello it sent, so a refusal of some other exchange — an impostor's, sent to the id it claimed, or a forgery — never ends this joiner's admission or its reconnect. null only where the refused Hello carried no nonce: one that predates v3, refused by the version gate. Width Hello.JOINER_NONCE_SIZE, checked in the constructor.

supersededBy — the us.tractat.kuilt.core.PeerId value of the member that took the joiner's seat over, on a RejectCode.Superseded refusal and on no other (v7, Decided 32, #3695). The host refuses that way a Hello under a superseded id and the key that was superseded, while the successor holds the seat. A new process of the device reusing the old id has no host to take a Farewell from, so the refusal names its Hello instead, and the joiner ends Left(self, LeaveReason.Superseded(by)). Both halves are checked in the constructor, and a superseded refusal always names the Hello it answers.

retryable — whether the sender's code said retrying could succeed (v8, Decided 25, #3276). A joiner reads it only for a code it does not know, which decodes as RejectCode.Unknown(id, retryable): an app's own terminal refusal then stays terminal, and a joiner's reconnect stops saying Hello to a host that refused it for good. A code the joiner knows keeps the retryability this build gives it, whatever this says: an app's policy may refuse with its own code under one of kuilt's ids, and the frame still goes and still decodes. null when the sender stated none, which leaves an unknown code retryable.

Construct with the typed secondary constructor: Reject(reason, RejectCode.RoomMismatch, nonce), or superseded for a RejectCode.Superseded refusal.

Constructors

Link copied to clipboard
constructor(reason: String, codeId: String? = null, answers: ByteArray? = null, supersededBy: String? = null, retryable: Boolean? = null)
constructor(reason: String, code: RejectCode, answers: ByteArray?)

A refusal for code of the Hello whose nonce is answers, stating whether code is retryable.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The structured cause: a code this build knows, or RejectCode.Unknown with the sender's retryable when the sender named one it does not.

Link copied to clipboard
@SerialName(value = "code")
val codeId: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares answers by content: a decoded Reject equals the one that was encoded.

Link copied to clipboard
open override fun hashCode(): Int