Background
Currently, QuickSurveys adds the ext.quicksurveys.init RL module to the output if the page exists, regardless of whether there are any surveys defined and that are enabled. This causes two issues, one minor and one major in the case of the Wikipedias:
- There's is a performance penalty as the module (and its ext.quicksurveys.lib dependency) is loaded for every mainspace page that exists
- If you have responses cached at the edge and disable the QuickSurveys extension, then RL will trigger an error for every mainspace pageview (for pages that exist) as the ext.quicksurveys.init module no longer exists but is still referenced
Performance
ext.quicksurveys.lib is 2.4kb and ext.quicksurveys.init 641 bytes.
Testing Environment for QA
None. However, see T209882#4868432 for an example of 2 that occurred in the wild.
Acceptance Criteria
- When there are no surveys defined/enabled, then the ext.quicksurveys.lib RL module is not added to the output (or the code it loads is minimised to a conditional client-side check)
- This behaviour is documented
- Including a note about not immediately disabling the extension after running a survey
Notes
@Krinkle's suggested approach: T213459#4871107
QA Steps
Since there are currently four surveys enabled on the Beta Cluster…
Scenario 1
- Navigate to https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page
- Observe that a survey doesn't appear
Scenario 2
- Navigate to https://en.wikipedia.beta.wmflabs.org/
- Run localStorage.clear();
- Click "Random page"
- Navigate to https://en.wikipedia.beta.wmflabs.org/wiki/Special:Random
- Observe that a survey appears
QA Results
AC | Status | Details |
---|---|---|
1 | ✅ | T213459#5819682 |
2 | ✅ | T213459#5819682 |