syncStatus
syncStatusCheck local progress or results of the current or last mail sync without starting a new sync or contacting the server, so you can decide whether to keep waiting.
Instructions
Read local progress or the result of the current or last sync; this does not start a sync or contact the mail server. state=running means still working; completed means the run finished; failed means the run stopped with an error; interrupted means the syncing process ended before finishing; never means no sync is recorded. phase is the stage reached; checkingLocal and checkingFolders can take minutes with no folder progress yet.
While running, other tools may see incomplete results. Check state to decide whether to keep waiting. The failed count is a count of messages: completed can still have failed>0. Inspect error and signInRejected for a failed run. If signInRejected is true, tell the user to fix credentials and run mail-sync in a terminal; repeated sync calls cannot recover it. Timestamps describe this run, not a guarantee that the local mail is current now.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | Yes | Connection name from listConnections |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Why the sync failed. | |
| phase | No | Stage reached, in order: checkingLocal (comparing saved messages with the index, offline; long after a run that did not complete), signingIn, checkingFolders (collecting changes from every folder), applyingChanges (moves and flag changes), downloading (removing and downloading folder by folder). For failed or interrupted, the stage where the run stopped. Absent for never and for runs recorded by an older version. | |
| state | Yes | running (still working), completed (run finished, possibly with individual message failures), failed (run stopped with an error), interrupted (syncing process ended before finishing), or never (no recorded sync). | |
| failed | Yes | Count of new messages that failed to download or convert, all folders. May be nonzero even when state is completed. | |
| folders | Yes | Progress per folder. | |
| removed | Yes | Local messages removed because they are gone from the mailbox, all folders. | |
| startedAt | No | When the sync started. | |
| connection | Yes | Connection name. | |
| downloaded | Yes | New messages saved, all folders. | |
| finishedAt | No | When the sync ended; absent while running. | |
| signInRejected | Yes | True when the mailbox rejected the sign-in; sync works again only after the user fixes the credentials and runs mail-sync in a terminal. |