Background
-Multiple bugs with session tick mixin were discovered, this task is to fix them for the Ab test deploy next week
User story
- As a data analyst, I need reliable session tick events to do analysis for the AB test
Requirements
- Session tick 0 is fired immediately the first time the search experience is opened
- Subsequent ticks are fired every 30 seconds after
- ticks are paused when the user navigates away from the tab making it inactive
- After 100 seconds of inactivity (no clicks, scrolling, navigation, etc), the tick events stop, but when the activity is resumed again the ticks continue
- After 30min of inactivity, and then activity is resumed, the ticks begin again but the action_context gets reset to 0.
- The patch has been backported to production so we can perform data QA.
BDD
Feature: Ensure session tick events fire correctly for A/B test
Scenario: Session tick 0 fires immediately when search is opened
Given a user logs in on mobile
When they click the search bar for the first time
Then a tick event with action context 0 is fired
Scenario: Session tick events fire every 30 seconds
Given the user has opened the search experience
When 30 seconds pass
Then a new tick event should fire with an incrementing action context
Scenario: Tick events pause when the tab is inactive
Given the user has session ticks firing
When the user navigates away from the tab
Then tick events should stop
Scenario: Tick events resume when activity is detected
Given tick events stopped due to inactivity
When the user navigates back to the tab
Then tick events should continue firing
Scenario: Tick events stop after 100 seconds of inactivity but resume
Given a user has session ticks firing
When no user interaction occurs for 100 seconds
Then tick events stop
When activity resumes
Then tick events continue
Scenario: Tick events continue after navigation
Given session tick events are firing
When the user navigates to a different article page
Then tick events should continue firing
Scenario: Tick events reset action_context after 30 minutes of inactivity
Given a user has session ticks firing
When the user is inactive for 30 minutes
Then tick events should restart
And action_context should reset to 0Test Steps
- Log in on mobile.
- Open the browser console and enter the following command:
mw.loader.using('mediawiki.api').then(function () {
new mw.Api().saveOption('eventlogging-display-console', '1');
});- Refresh the page and navigate to an article page.
- AC1: Confirm no A/B test events are fired.
- Click the search bar.
- AC2: Confirm a tick event with action context of 0 is fired.
- AC3: Confirm tick events are fired every 30 seconds with an incrementing action context.
- Navigate away from the browser tab and wait 5 minutes.
- AC4: Confirm that tick events stop while the tab is inactive.
- Navigate back to the browser tab.
- AC5: Confirm that tick events resume.
- Stay on the tab and keep the mouse still for over 100 seconds.
- AC6: Confirm that tick events stop after 100 seconds of inactivity.
- Resume activity (e.g., move the mouse or click).
- AC7: Confirm that tick events resume after user activity.
- Navigate to a different article page.
- AC8: Confirm that tick events continue after navigation.
- Remain inactive for 30 minutes.
- Resume activity.
- AC9: Confirm that tick events restart with action_context reset to 0 after 30 minutes of inactivity.
QA Results - Beta
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T386495#10577238 |
| 2 | ✅ | T386495#10577238 |
| 3 | ✅ | T386495#10577238 |
| 4 | ✅ | T386495#10577238 |
| 5 | ✅ | T386495#10577238 |
| 6 | ✅ | T386495#10577238 |
| 7 | ✅ / ❓ | T386495#10577238 Please review AC7 |
| 8 | ✅ | T386495#10577238 |
| 9 | ✅ | T386495#10577238 |
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T386495#10585744 |
| 2 | ✅ | T386495#10585744 |
| 3 | ✅ | T386495#10585744 |
| 4 | ✅ | T386495#10585744 |
| 5 | ✅ | T386495#10585744 |
| 6 | ✅ | T386495#10585744 |
| 7 | ✅ / ❓ | T386495#10585744 The behavior exhibited already was accepted in beta, I'm just highlighting it here as well. |
| 8 | ✅ | T386495#10585744 |
| 9 | ✅ | T386495#10585744 |





