Skip to main content

handle_query_changes

Function handle_query_changes 

Source
pub async fn handle_query_changes<O: QueryObject, B: JmapBackend>(
    backend: &B,
    caller: &B::CallerCtx,
    args: Value,
) -> Result<HandlerOutput, JmapError>
Expand description

Generic */queryChanges handler (RFC 8620 §5.6).

Parses filter and sort from args, then delegates to JmapReads::query_changes with collapse_threads: false. For Email/queryChanges (which may need collapseThreads: true), use the domain-specific handler in jmap-mail-server instead.

Like handle_get it does not see using, so a non-null language (draft-atwood-jmap-updates-00 §4.2) is invalidArguments. A type with JmapObject::LOCALIZABLE properties uses handle_query_changes_with_i18n or its own handler.

§Errors

Method-level errors, returned as the JmapError:

  • invalidArguments if args is not an object or accountId is missing or not a valid Id. Also when sinceQueryState is missing, maxChanges is not a positive integer, upToId is neither a string nor null, filter is not an object, sort is not an array of comparators, or language is non-null.
  • accountNotFound if the backend reports no such account; serverFail (with a redacted description) if that check fails.
  • unsupportedFilter if filter is an object that does not decode as the type’s filter.
  • A BackendQueryError::Method from the backend unchanged (for example cannotCalculateChanges); any other backend error becomes the redacted serverFail.