Page MenuHomePhabricator

Choose the correct QuickSurveys survey without using a URL param
Closed, ResolvedPublic3 Estimated Story Points

Description

Special:SimilarEditors displays a QuickSurveys survey on successful form submission. It uses the quicksurvey URL param to ensure the the correct survey is shown, and that it always shown, even if the user has already submitted an answer.

However, in T310857 we will be using a POST request instead, so this mechanism won't work any more.

AC
  • The correct survey is shown without using any URL parameters
  • The survey is shown even if the user has submitted a response before

Event Timeline

Tchanders renamed this task from Choose the correct QuickSurvey without using a URL param to Choose the correct QuickSurveys survey without using a URL param.Jul 20 2022, 2:29 PM
Tchanders set the point value for this task to 3.

Change 820786 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/SimilarEditors@master] Show survey via a JS module rather than a URL param

https://gerrit.wikimedia.org/r/820786

Using the URL parameter was included to force the survey to show even when the user has answered it once, as discussed in T297687.

It should have been possible to do this using mw.extQuickSurveys.showSurvey( 'similareditors' ), but loading the module that provides that function unconditionally attempts to show an eligible survey, before the function is called - which could result in two surveys being shown. This is considered a bug: T307954: Allow developers to call showSurvey() without unintentionally showing another survey

That bug must be solved before this task can be done. I've made T307954 a subtask of this task and uploaded patches for both.

Change 820786 merged by jenkins-bot:

[mediawiki/extensions/SimilarEditors@master] Add new JS module for displaying a survey

https://gerrit.wikimedia.org/r/820786

  • The correct survey is shown without using any URL parameters

The survey is shown after submitting the form and assuming no error is returned (e.g. timeout, non-existent user).

I can confirm that, after 10-20 tries, it always shows the same survey.

  • The survey is shown even if the user has submitted a response before

Yes, also if you dismiss the survey (using the x).

Test environment:

Test browser: Firefox 91.