Skip to content

CommitResult

Holds the outcome of applying an MLS commit message via Session:processCommit.

A commit can succeed (the group epoch advanced), be ignored (the commit was redundant or out-of-order), or fail hard (the commit was malformed). Always inspect isFailed and isIgnored after calling Session:processCommit.

After inspecting the result, call destroy to free the underlying handle.

CommitResult.handle  :: CommitResultHandle

Opaque handle to the underlying libdave commit result object.

CommitResult : isFailed ( )  -> boolean

Returns true if the commit was hard-rejected by the library. A failed commit indicates a protocol violation; the session should be reset.

Returns

boolean
CommitResult : isIgnored ( )  -> boolean

Returns true if the commit was soft-rejected (ignored). This typically means the commit was a duplicate or arrived out of order. No epoch transition occurred and the session state is unchanged.

Returns

boolean
CommitResult : getRosterMemberIds ( )  -> { string }

Returns the user IDs of every member in the group roster after the commit was applied, as a list of decimal snowflake strings. An empty list means no members remain (the group was torn down).

Returns

{ string }
CommitResult : getRosterMemberSignature ( rosterId )  -> buffer

Returns the MLS credential signature for the roster member identified by rosterId (a decimal snowflake string). The signature bytes can be used to verify that the member’s key package was signed by a trusted identity key.

Parameters

rosterId: string

Returns

buffer
CommitResult : destroy ( )  -> ()

Destroys the commit result and frees all associated libdave resources. Must be called after the result has been fully inspected.

CommitResult . new ( handle )  -> CommitResult

Constructs a CommitResult wrapper around an existing libdave handle. Called internally by Session:processCommit.

Parameters

handle: CommitResultHandle

Returns

CommitResult