Fix loading state logic ignoring errors in components #1995
Comments
|
@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. |
QA
|
|
@felixarntz i have created a PR that fixes this issue: #2300. |
|
Tested Installed, activated and setup latest SK. Confirmed functionality specifically around data loading for: Adsense - Pass One thing to note: This is unrelated but noting that the loading bars are displayed on refresh. Passed QA |



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
ProgressBardepends 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.
Acceptance criteria
undefinedwhich have a resolver. Whenever a selector has a resolver, such logic should rely onhasFinishedResolutionfor the selector instead.Implementation Brief
<ProgressBar>when data selected from the datastore=== undefinedto use! hasFinishedResolutionselector instead (only for selectors with a resolver).Note, not all selectors have a dedicated selector but use a parent selector which has a resolver. In this case, the "closest" resolver in the selector chain should be checked.
Also, special care should be taken to ensure bugs are not introduced by changing the conditional to return when something is
undefined. It will now be possible for these selected values to beundefined(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.jsundefinedso they only need the same resolver check addedYou can see an example of this done correctly in
assets/js/modules/analytics/components/settings/SettingsEdit.jsassets/js/modules/analytics/components/common/AccountCreateLegacy.jsassets/js/modules/analytics/components/common/ProfileSelect.jsassets/js/modules/analytics/components/common/PropertySelect.jsQA Brief
Changelog entry
The text was updated successfully, but these errors were encountered: