pub async fn handle_task_query<B: TasksBackend>(
backend: &B,
caller: &B::CallerCtx,
args: Value,
using: &[String],
) -> Result<HandlerOutput, JmapError>Expand description
Handle a Task/query method call (draft-tasks-06 §4.13).
args is the RFC 8620 §5.5 /query request shape (accountId,
optional filter, optional sort, optional position, optional
anchor, optional anchorOffset, optional limit, optional
calculateTotal); the returned Value is the §5.5 /query
response shape (accountId, queryState, canCalculateChanges,
position, ids, optional total).
The Task/query arguments of jmapio/jmap #456, as on CalendarEvent/query (draft-ietf-jmap-calendars-34 §5.11):
expandRecurrences: Boolean (defaultfalse). “If true, the filter MUST be just aFilterCondition(not aFilterOperator) and MUST include both a “before” and “after” property; otherwise, the server MUST reject the call with an invalidArguments error.“ A window longer thanTasksLimits::max_expanded_query_duration_seconds(maxExpandedQueryDuration, draft-tasks-06 §1.6.2) is theexpandDurationTooLargemethod error, checked here and again by the backend.timeZone:TimeZoneId(default"Etc/UTC"), the zone for theafter/beforeconditions and for floating tasks. A value that is neither a string nornullisinvalidArguments.
Both reach TasksBackend::query_tasks as a
TaskQueryArgs. The backend may also return
cannotCalculateOccurrences.
using is the request’s capability list (pass
jmap_server::CallContext::using); without
urn:ietf:params:jmap:metadata a draft-ietf-jmap-metadata-05 §3.6
filter condition is unsupportedFilter (-05 §3).
Returns (response_args, extra_invocations). The extra list is always empty.
§Errors
Returns a method-level JmapError:
invalidArgumentswhenaccountIdis missing or not a valid Id, or whenfilter,sort,position,anchor,anchorOffsetorlimitis malformed,timeZoneis not a string, orexpandRecurrencesis set without a filter condition that has bothbeforeandafter;accountNotFoundwhen the backend does not knowaccountId;unsupportedFilterwhen the filter does not decode as aTaskfilter or uses a metadata condition withouturn:ietf:params:jmap:metadatainusing;unsupportedSortwhensortnames a property that is not supported;expandDurationTooLargewhenexpandRecurrencesspans more than the account’smaxExpandedQueryDuration;serverFailwhen the backend fails, or any other RFC 8620 §5.5 error the backend returns, such asanchorNotFound.