Skip to Content

The LabelMessagesUpdateResult type of the TypeScript SDK, which labels.updateMessages and labels.updateMessagesById take or answer.

type LabelMessagesUpdateResult = {
  archived: number
  examined: number
  expunged: number
  failed: number
  nextAfter: number | null
  remaining: number
  uidMax: number
  uidValidity: number
  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".
examinednumberMemberships this call looked at, filtered-out ones included
expungednumberMessages whose last label this patch removed: they moved to the Recently-deleted tier, restorable until purge. Counted here rather than in updated.
failednumberPer-message refusals — a keyword cap, or a row that left the label between this call's scan and its write. Not an error: the rest of the call applied.
nextAfternumber | nullContinuation cursor: call again with after set to this, the same uidMax, and the same patch. null means the range is drained. Repeating a call is harmless — a patch that changes nothing writes nothing, and a filing patch's earlier pages have already left the range.
remainingnumberMemberships left in the range this call did not reach, 0 when it finished. This counts what is UNEXAMINED, not what would match a flag filter — it is the figure a progress bar needs, and it is exact.
uidMaxnumberThe resolved ceiling this call worked under. Send it back UNCHANGED on a continuation: it is what keeps the selection the one the user saw, and re-resolving it would let mail that arrived since drift into the gesture.
uidValiditynumberUIDVALIDITY epoch of the label the patch ran against
unchangednumberMessages in the selection the patch provably would not have changed, so they were skipped
updatednumberMessages the patch changed

Used by

MethodWhat it does
labels.updateMessagesUpdate flags, labels and keywords for every message in a folder
labels.updateMessagesByIdUpdate flags, labels and keywords for every message in a folder, by label id

On this page