Skip to main content

handle_space_changes

Function handle_space_changes 

Source
pub async fn handle_space_changes<B: ChatBackend>(
    backend: &B,
    caller: &B::CallerCtx,
    args: Value,
    using: &[String],
) -> Result<HandlerOutput, JmapError>
Expand description

Handle a Space/changes method call (draft-atwood-jmap-chat-00 §Space).

args is the RFC 8620 §5.2 /changes request shape (accountId, sinceState, optional maxChanges); the returned Value is the §5.2 /changes response shape (accountId, oldState, newState, hasMoreChanges, created, updated, destroyed).

using is the request’s capability list (pass jmap_server::CallContext::using); with urn:ietf:params:jmap:metadata the request may set draft-ietf-jmap-metadata-05 §3.3 ignoreMetadataOnlyChanges, and without it metadata-only changes are left out (-05 §3).

Returns (response_args, extra_invocations). The extra list is always empty.

§Errors

Returns a method-level JmapError:

  • invalidArguments when accountId is missing or not a valid Id, sinceState is missing, maxChanges is not a positive integer, or ignoreMetadataOnlyChanges is not a boolean;
  • accountNotFound when the backend does not know accountId;
  • cannotCalculateChanges when the backend cannot compute the changes since sinceState;
  • serverFail when the backend fails.