Sets the phase and pushes the current progress immediately, without waiting for the next unit of work. For phases entered while no counts are flowing — e.g. the OneNote importer waiting out Graph throttling, where the next increaseProgressCount() may be an hour away — setPhase() alone would leave the client showing the previous label (and a seemingly hung count) the whole time.
Resets the running progress count back to zero. Useful for multi-phase tasks (e.g. zip export, which first walks the tree to build metadata and then walks it again to write content) so a later phase can drive a 0→100% progress bar from scratch instead of continuing the earlier phase's count.
Records a deleteId whose entities are to be erased once the task group ends. Erasing flags entity changes as erased, which makes every connected client reload; a delete-notes group spans one request per branch, so erasing before the last one cuts off the requests the client has yet to send.
Labels the phase the subsequent progress counts belong to, so the client can render a phase-specific message (e.g. "Extracted X items" vs "Processed X notes"). Typically paired with resetProgressCount() and setTotalCount() at a phase boundary so each phase drives its own 0→100% bar. Forces the next progress message to send immediately (bypassing the throttle) so the label switches without delay.
Sets the total expected units of work, so progress messages can carry a denominator and the client can show a progress bar instead of a bare count. Optional — tasks that don't know their total up front simply never call this.
Returns the deleteIds collected by scheduleErase and clears them.
Staticget
Clears the phase so subsequent progress messages drop the label. Does not send by itself: callers clear right before counting the unit of work that ended the phase, and the forced flush here makes that very next increaseProgressCount() deliver the corrected label and count in one message.