question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Show errors instead of infinite loading state in AdSense V2 setup flow

See original GitHub issue

Bug Description

In case of API errors, the V2 setup currently remains in an infinite loading state instead of showing the error to the user.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The AdSense V2 SetupMain component should be adjusted to show any relevant errors: Similar to the V1 version of the component, if there are any AdSense API errors (via hasErrors selector), it should show the errors via the AdSense ErrorNotices component.
    • In such cases, only that component should be shown instead of the regular SetupCreateAccount, SetupSelectAccount, or SetupAccount.
  • The AdSense ErrorNotices component should be slightly adjusted: If the adsenseSetupV2 feature flag is active, it shouldn’t call the errorToStatus utility function to decide whether an error should show. Any error should show in the V2 flow.

Implementation Brief

SetupMain component

Within file assets/js/modules/adsense/components/setup/v2/SetupMain.js:

ErrorNotices component

Within file assets/js/modules/adsense/components/common/ErrorNotices.js:

  • Use the useFeature hook to check whether the adsenseSetupV2 feature flag is enabled.
  • Update the rendered StoreErrorNotices component, passing undefined for the shouldDisplayError prop if the feature flag is enabled, otherwise continue to pass the shouldDisplayError callback.

Storybook

  • Add a new story for V2 SetupMain displaying the error state.

Test Coverage

  • No new tests needed.

QA Brief

  • Ensure the Adsense Setup V2 Error Notice story displays the error instead of the loading state. Story URL path - /story/modules-adsense-components-setup-v2-setupmain--error-notice
  • Currently, we can’t test the error notice scenario using the tester plugin. Refer to this comment.

Changelog entry

  • Update the AdSense SetupMain component to show existing errors.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
felixarntzcommented, May 4, 2022

@hussain-t The observation by @wpdarren is valid. What you’re describing is correct, but that is particularly the problem why this is not working like it should. We need to make sure that we don’t just keep showing the ProgressBar when there are errors.

In general, looking for undefined values as the indicator for whether to show a loading state is a bit unreliable, for this very reason, that the request could have an error, in which case it should be displayed. We should use ! hasFinishedResolution for the relevant selector to show the loading state.

Can you please open a PR based on main to fix this?

0reactions
wpdarrencommented, May 5, 2022

QA Update: ✅

  • The Adsense Setup V2 Error Notice story displays the error instead of the loading state. Story URL path - /story/modules-adsense-components-setup-v2-setupmain--error-notice
  • I also tested this on my test site. The error now appears as expected.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix AdSense crawler issues - Google Support
If the AdSense ads crawler can't access your content, refer to the following list of crawler issues to help you fix the problem....
Read more >
Site Kit by Google – Analytics, Search Console, AdSense, Speed ...
Quick setup for multiple Google tools without having to edit the source code of your site; Metrics for your entire site and for...
Read more >
Evolving "nofollow" – new ways to identify the nature of links
This has now changed. All the link attributes— sponsored , ugc , and nofollow —are treated as hints about which links to consider...
Read more >
readme.txt - HSDC
2. Follow the instructions in the setup flow. 3. ... Fix an infinite loading state when attempting to create a new Analytics account...
Read more >
readme.txt
2. Follow the instructions in the setup flow. 3. ... Fix infinite loading state for components relying on gathering or zero data reports....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found