Improve account status handling
Open, NormalPublic


We currently use the following algorithm for the account status (which we display in kube):

const auto status = [&] {
    if (states.contains(ApplicationDomain::ErrorStatus)) {
        return ApplicationDomain::ErrorStatus;
    if (states.contains(ApplicationDomain::BusyStatus)) {
        return ApplicationDomain::BusyStatus;
    if (states.contains(ApplicationDomain::OfflineStatus)) {
        return ApplicationDomain::OfflineStatus;
    if (states.contains(ApplicationDomain::ConnectedStatus)) {
        return ApplicationDomain::ConnectedStatus;
    return ApplicationDomain::NoStatus;

This means that as long as one resource is offline all are offline.
Because we don't trigger syncs for all resources at the same time this means the account can remain offline or in an error status even though some resources may operate perfectly fine.

After some time we should operate on a clean slate again, and a successful sync of one resource should result in an overall connected status.

One idea would be to only ever use transitions of individual resources, which would mean the overall account status would be whatever the last resource reported.

On a side note, this part of the code in sink is rather complicated and it would be nice if we could remove the whole status merging complexity from sink.

cmollekopf triaged this task as Normal priority.