This started as part of #1859, but was since separated out to keep issue scope more manageable. Some module components (mostly setup/settings-related) currently have the problem that the logic for displaying the overall ProgressBar depends on data being returned from an API - however, if an error occurs during an API request, that data will never be populated, keeping the component in an infinite loading state.
Instead of relying on selector-based data to exist, it should be relied upon whether the respective resolver has finished, which will work for both the success and error case.
_Do not alter or remove anything below. The following sections will be managed by moderators only._
undefined which have a resolver. Whenever a selector has a resolver, such logic should rely on hasFinishedResolution for the selector instead.<ProgressBar> when data selected from the datastore === undefined to use ! hasFinishedResolution selector instead (only for selectors with a resolver).undefined. It will now be possible for these selected values to be undefined (such as in the event of an error) beyond the progress bar conditional, so we should pay extra attention to ensure potential type errors are handled.assets/js/modules/adsense/components/common/AccountSelect.jsassets/js/modules/adsense/components/common/SiteSteps.jsassets/js/modules/adsense/components/common/UserProfile.jsassets/js/modules/adsense/components/settings/SettingsEdit.jsassets/js/modules/adsense/components/setup/SetupMain.jsassets/js/modules/analytics/components/common/AccountSelect.jsassets/js/modules/analytics/components/common/AccountCreate/index.jsassets/js/modules/tagmanager/components/common/AccountCreate.jsassets/js/modules/tagmanager/components/common/AccountSelect.jsassets/js/modules/tagmanager/components/common/ContainerSelect.jsundefined so they only need the same resolver check addedassets/js/modules/analytics/components/settings/SettingsEdit.js_assets/js/modules/analytics/components/common/AccountCreateLegacy.jsassets/js/modules/analytics/components/common/ProfileSelect.jsassets/js/modules/analytics/components/common/PropertySelect.js@aaemnnosttv I've copied the relevant piece of the IB from #1859, assigning to you for double-checking and providing an estimate.
IB ✅
@eugene-manuilov Can you add QA Brief for this one?
QA Brief is added.
@eugene-manuilov While testing something else, I ran into a problem which is likely a regression caused by the changes here. What I did was the following:
web property: UA-xxxxxx-x not found.. For some reason, after updating the account, the plugin makes a request to the profiles datapoint with the _previously_ selected property. That property of course is not part of the newly selected account though (you can already tell that because the xxxxxx out of the UA-xxxxxx-x ID must match the account ID), therefore it isn't found. I assume there is some out of sync inconsistency introduced here: When selecting another account, we need to update both the account ID and property ID (the latter needs to be immediately set to its "empty" value) to avoid such a request.Screenshot:

@felixarntz i have created a PR that fixes this issue: https://github.com/google/site-kit-wp/pull/2300.
Tested
Installed, activated and setup latest SK.
Confirmed functionality specifically around data loading for:
Adsense - Pass
Analytics - Pass
Tag Manager - Pass
One thing to note:
When switching date ranges, we're not showing a loading bar for Analytics and Adsense.
This is unrelated but noting that the loading bars are displayed on refresh.
Passed QA ✅