google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.23k stars 286 forks source link

GA4 setup tooltip raises React error #6832

Closed aaemnnosttv closed 1 year ago

aaemnnosttv commented 1 year ago

Bug Description

In #6330 we decoupled the web data stream selection from the property select which used to handle both. In doing so, it also fixed a minor bug where the disabled property select (when GA4 wasn't enabled yet) so that it wouldn't load any options until enabled. This had a side effect of breaking the tooltip that we show when clicking the CTA to "Connect Analytics 4" as this enables GA4 at the same time. The tooltip sees its target is present (the select) but it is immediately removed due to the loading state (it's replaced by the progress bar). This causes the mutation observer to error because the element is no longer in the DOM.

Steps to reproduce

  1. Set up GA without GA4
  2. Go to GA settings edit
  3. Click CTA to "Connect Analytics 4"
  4. See error

Screenshots

The moment the error is raised

image

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

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

aaemnnosttv commented 1 year ago

@nfmohit IB sounds like an elegant fix to me 👍 My only concern is that it might become un-disabled immediately and then replaced by the progress bar 🤔 Let's try it and see!

IB ✅

aaemnnosttv commented 1 year ago

@wpdarren @mohitwp this should fix the issue flagged here https://github.com/google/site-kit-wp/issues/6774#issuecomment-1498805535

wpdarren commented 1 year ago

QA Update: ✅

Verified:

image

@mohitwp it would be good to get a second pair of eyes on this, would you be able to look over it since you discovered the initial issue while release testing. I have assigned you, but just send it to approval if you think it looks good.

mohitwp commented 1 year ago

QA Update ✅

https://user-images.githubusercontent.com/94359491/230857448-445429ae-e9de-4626-b95e-b9bea582d403.mp4