Skip to main content

handle_changes

Function handle_changes 

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

Generic */changes handler (RFC 8620 §5.2).

using is the request’s capability list (crate::CallContext::using). When it includes urn:ietf:params:jmap:metadata, the optional ignoreMetadataOnlyChanges argument (draft-ietf-jmap-metadata-04 §3.3) is parsed, and must be a boolean; otherwise the backend is told to ignore metadata-only changes, because -04 §3 says such a request “MUST behave as if ignoreMetadataOnlyChanges were true”.

updatedProperties is ChangesResult::updated_properties (RFC 8621 §2.2, -04 §3.3), and null whenever updated is empty (-04 §3.3: “It is always present, and is null when updated is empty”). Backends that do not track per-property change detail MUST leave it None: an empty array would mean “nothing about the listed objects actually changed”.