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.
Summary
Properties
Section titled “Properties”handle
Section titled “handle”Opaque handle to the underlying libdave commit result object.
Methods
Section titled “Methods”isFailed
Section titled “isFailed”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 |
isIgnored
Section titled “isIgnored”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 |
getRosterMemberIds
Section titled “getRosterMemberIds”CommitResult : getRosterMemberIds ( ) -> { string }
Returns the user IDs whose keys this commit added, changed or removed, as decimal snowflake strings. This is a
change set against the session's previous roster, not the whole roster: members whose keys did not change are not
listed. A removed member's getRosterMemberSignature is empty. Empty for a failed or ignored commit.
Returns
| { string } |
getRosterMemberSignature
Section titled “getRosterMemberSignature”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.
Empty for a member this commit removed. Pass only an id from this result's getRosterMemberIds: libdave aborts
the process for any other.
Parameters
| rosterId: string |
Returns
| buffer |
destroy
Section titled “destroy”CommitResult : destroy ( ) -> ()
Destroys the commit result and frees all associated libdave resources. Must be called after the result has been fully inspected.
Functions
Section titled “Functions”CommitResult . new ( handle ) -> CommitResult
Constructs a CommitResult wrapper around an existing libdave handle. Called internally
by Session:processCommit.
Parameters
| handle: CommitResultHandle |
Returns
| CommitResult |