Skip to Content

The QueryMessagesUpdateResult type of the TypeScript SDK, which search.updateMatches take or answer.

type QueryMessagesUpdateResult = {
  archived: number
  examined: number
  expunged: number
  failed: number
  idMax: string
  nextAfter: string | null
  unchanged: number
  updated: number
}

Fields

FieldTypeDescription
archivednumberMessages whose last label this patch removed that fell back to the Archive label instead of being expunged. Unlike expunged, this is a SUBSET of updated, not an alternative to it: an archived message was still updated, so examined equals updated + unchanged + expunged + failed and adding archived to updated double counts. Only present when the patch carried orphans: "archive".
examinednumberMessages the query selected in this call
expungednumberMessages whose last label this patch removed: moved to the Recently-deleted tier, restorable until purge. Counted here rather than in updated.
failednumberPer-message refusals. Not an error: the rest of the call applied.
idMaxstringThe ULID ceiling this call worked under. Send it back UNCHANGED on a continuation: it is what keeps the selection the one the search showed, and re-resolving it would let mail that arrived since drift into the gesture.
nextAfterstring | nullContinuation cursor: call again with after set to this, the same idMax, the same filter and the same patch. null means the selection is drained. There is no remaining count — counting what is left of a filter is an aggregate over the whole filtered set on every call. Measure progress against the search's own total.
unchangednumberSelected messages the patch provably would not have changed, so they were skipped
updatednumberMessages the patch changed

Used by

MethodWhat it does
search.updateMatchesUpdate flags, labels and keywords for every message a search selects

On this page