As the developer you need to provide your customer with a seamless experience, this includes dealing with inevitable disconnects, handling them and understanding why they occur.
Every account will all stop at some point. The provider does NOT tell us why, ensure you have systems in place to handle for such events.
How to handle stopped accounts?
- Detect when an account is stopped or invalid, use webhooks.
- Have logic to prompt the customer to re-authenticate when they are disconnected
Why has the account stopped?
Event: Received account.invalid webhook sync_state is invalid
- Password expiry policy (set by customers' mail administrator)
- Conditional access policy (set by customers' mail administrator)
- Credentials Invalid - see sync_state
Event: Received ONLY account.stopped webhook sync_state is stopped
- Manually Stopped - see this guide to identify and resolve the issue.
- Connection server issues - see Sync Logs
- Retries exceeded - see Sync logs
- Parsing error - see Sync Logs
- Mail administrator has blocked / suspended the account - See Sync logs
After starting an account it will go into the Partial state, where it will remain until it we have retried the account 6 times over an hour before stopping again.
The solution to all the above is to Re-authenticate the account.
If the account continuously goes into an invalid or stopped state after authentication:
If Microsoft O365 account:
- Ask the mail administrator to check the Azure > Login logs
If Microsoft Outlook / Hotmail account:
- Ask the customer to check their Sign-In activity