It appears that the Plugin autoupdate guided tour will sometimes display the success message before the user has actually enabled the autoupdate toggle for Jetpack.
:site is the site slugI _sometimes_ see a success message, although I haven't yet activated the autoupdate toggle.

This defect was discovered by @jeffgolenski while testing the security checklist: https://cloudup.com/cqK-IkaWi3O
Hey Luna! 馃憢 Just tested again and confirmed this is still a 馃悶.
Relevant files:
The latter fires a number of Tracks events that can be used for debugging by entering
localStorage.setItem( 'debug', 'calypso:analytics:tracks' )
into the browser console and reloading prior to testing that flow. This gives

Seems like when doesn't behave as expected. I'd expect the following to not show any Guided Tour at all, but instead, it also shows the 'Success' step:
diff --git a/client/layout/guided-tours/tours/jetpack-plugin-updates-tour/index.js b/client/layout/guided-tours/tours/jetpack-plugin-updates-tour/index.js
index ae4ea0daa8..c69fd38b20 100644
--- a/client/layout/guided-tours/tours/jetpack-plugin-updates-tour/index.js
+++ b/client/layout/guided-tours/tours/jetpack-plugin-updates-tour/index.js
@@ -26,12 +26,7 @@ export const JetpackPluginUpdatesTour = makeTour(
<Tour { ...meta }>
<Step
name="init"
- when={ state => {
- const site = getSelectedSite( state );
- const res =
- ! PluginsStore.isFetchingSite( site ) && !! PluginsStore.getSitePlugin( site, 'jetpack' );
- return res;
- } }
+ when={ () => false }
target=".plugin-item-jetpack .form-toggle__switch"
arrow="top-left"
placement="below"
If I change that return value to true, things _almost_ work: I get the first step (asking me to enable autoupdates for the Jetpack plugin) -- but only after scrolling.
Re-reading https://github.com/Automattic/wp-calypso/blob/master/client/layout/guided-tours/docs/API.md, we might've just added the when prop erroneously to Step rather than Tour :thinking:
For Tour:
when(function, optional): This is a Redux selector function. Use this to define conditions for the tour to start. Can be overridden by adding atourquery argument to the URL like so:?tour=tourName, in which case the tour will be triggered even ifwhenwould evaluate tofalse. This is useful for sending along a tour via email or chat. On the other hand, the framework will try to not trigger a tour multiple times (seetoursSeenin ARCHITECTURE.md). Note: you can reset the tours history by adding?tour=resetto the URL.
For Step:
when: (function, optional) This is a Redux selector that can prevent a step from showing when it evaluates to false. When usingwhenyou should also set thenextprop to tell Guided Tours the name of the step it should skip to. If you omit this prop, step will be rendered as expected. Example usage would be to show a certain step only for non-mobile environments:when={ not( isMobile ) }
So it sounds like this behavior is normal, and the fix is to move the when prop to Tour. I'll file a fix.
@ockham I take this is now fixed?
So looks like a combination of https://github.com/Automattic/wp-calypso/pull/33258 and https://github.com/Automattic/wp-calypso/pull/33359 has solved this. Closing :thumbsup:
Feel free to re-open (or open new issue) if there still are pending issues.
Most helpful comment
Hey Luna! 馃憢 Just tested again and confirmed this is still a 馃悶.