Appointment can call the CalDAV setup endpoint after subscription activation has marked a user active, but before the async Stalwart account provisioning task has completed. In that window the user has no local primary Stalwart email yet, and thunderbird-accounts could throw an AccountFoundFoundError.
A better user experience is a two part fix.
On the thunderbird-accounts side, we'll start to return an HTTP 409 for this transitional state. Here on the accounts side, the backend can notice that state and retry (poll) for a bit until the the account is ready, possibly displaying some kind of "please wait" intermediate UI.
Recommended Appointment-side change
When Appointment’s backend calls POST /appointment/caldav/setup/, treat 409 as transient.
Appointment should not surface that as a “not found” or generic setup failure. It shouldwait and retry.
Implement it on the Appointment backend, not the browser, because this endpoint uses the shared Appointment secret. The Appointment frontend can poll its own backend or show a “finishing
account setup” state while the backend retries Thunderbird Accounts.
Suggested retry behavior:
- Retry only for 409 with code === "mail_account_not_ready".
- retry every 5 seconds
- Cap retries with a reasonable timeout, maybe 60-120 seconds.
- After timeout, show a soft failure like “Your mail account is still being prepared. Try again in
a minute.”
Related PR
Appointment can call the CalDAV setup endpoint after subscription activation has marked a user active, but before the async Stalwart account provisioning task has completed. In that window the user has no local primary Stalwart email yet, and
thunderbird-accountscould throw anAccountFoundFoundError.A better user experience is a two part fix.
On the
thunderbird-accountsside, we'll start to return an HTTP 409 for this transitional state. Here on the accounts side, the backend can notice that state and retry (poll) for a bit until the the account is ready, possibly displaying some kind of "please wait" intermediate UI.Recommended Appointment-side change
When Appointment’s backend calls
POST /appointment/caldav/setup/, treat 409 as transient.Appointment should not surface that as a “not found” or generic setup failure. It shouldwait and retry.
Implement it on the Appointment backend, not the browser, because this endpoint uses the shared Appointment secret. The Appointment frontend can poll its own backend or show a “finishing
account setup” state while the backend retries Thunderbird Accounts.
Suggested retry behavior:
a minute.”
Related PR