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.

Remote user surveys no longer triggering since 1.71.0

See original GitHub issue

Bug Description

User surveys for viewing the dashboard are no longer triggering, as I’ve noticed today. After some digging, it looks like this is due to #4806, which means this broke in 1.71.0.

The problem is the following: The triggerSurvey action now calls the isAuthenticated selector and bails if it is false-y. However, on page load that selector (as all our API-driven selectors) can be undefined, and this action call basically happens on page load, so in this case the triggerSurvey function bails just because the value for the selector isn’t loaded yet.

This is a critical bug so we need to fix it asap and get it into the upcoming 1.72.0 release.


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

Acceptance criteria

  • User surveys should only not be triggered via triggerSurvey if the user is not authenticated. Currently the action also bails when that selector’s value is undefined, i.e. not loaded yet.
  • We need to ensure the value is loaded at the point that the action accesses it.

Implementation Brief

The PR should be based on main.

const {
	__experimentalResolveSelect,
	select,
} = yield Data.commonActions.getRegistry();

yield Data.commonActions.await(
	__experimentalResolveSelect( CORE_USER ).getAuthentication()
);

if ( select( CORE_USER ).isAuthenticated() === false ) {
	return {};
}

Test Coverage

  • A data store test to ensure the result is returned would be a good starting-point safeguard here.

QA Brief

  • Ensure the google-site-kit/v1/core/user/data/survey-trigger request is made when viewing the SK dashboard
  • Session storage may need to be cleared for it to be triggered again

Changelog entry

  • Fix bug where user surveys would not trigger when viewing the dashboard.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
tofumattcommented, Apr 12, 2022

@aaemnnosttv Oops, yes, sorry, I forgot that one was an indirect selector, but thanks for getting the idea 😅. Also the double yield was indeed a typo 😅

@wpdarren I think that’s correct—I don’t think we currently trigger surveys on entity dashboard pages… that said I’m not sure why? 🤔

1reaction
aaemnnosttvcommented, Apr 11, 2022
yield yield Data.commonActions.await(
	__experimentalResolveSelect( CORE_USER ).isAuthenticated()
);

@tofumatt resolve select only works on selectors that have a resolver, so this would require selecting getAuthentication rather than isAuthenticated. (also there is a double yield there but I assume that’s just a typo 😄 )

Otherwise LGTM – I’ll update this detail in the IB and then this will be good to go 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

It's time to reimagine where and how work will get done - PwC
The success of remote work has reimagined how corporate work gets done, as well as where the work takes place. PwC's second survey...
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