Idle trigger calculates idle/silent time incorrectly
Categories
(Firefox :: Messaging System, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox117 | --- | fixed |
People
(Reporter: aminomancer, Assigned: aminomancer)
References
(Blocks 1 open bug)
Details
(Whiteboard: [omc])
Attachments
(1 file)
Over here, the idle trigger tries to check the number of milliseconds that have elapsed since the user went idle and sound stopped playing. (It checks for sound because a user might stop interacting with the browser even though they're actively watching a movie on netflix or something) Then it will expose this duration to message targeting so we can show messages exclusively to users who have been idle for 20+ minutes.
But the math is wrong here, it's trying to find how much time has passed since the last user interaction or audio, meaning we want to report "idle for milliseconds" or "silent for milliseconds", whichever is shorter. But idle time and silent time are stored as epochs, not as durations. So we don't want Math.min() to find the shortest duration, we want Math.max(), to get the most recent idle or silent epoch, and subtract it from the current epoch, to get the overall time that has passed without an interaction or a sound.
So the fix is very simple, we just need to change Math.min to Math.max.
Assignee | ||
Comment 1•2 years ago
|
||
Updated•2 years ago
|
What about the dashboard use case? I use firefox to display prometheus dashboards. These play no sound or other media and are "idle" but should not fire this trigger.
Comment hidden (advocacy) |
Comment 4•2 years ago
•
|
||
This bug is fixing the timing of the idle trigger which can be used for many things not just promotions. Filed bug 1835481 for confusion of unrelated pages.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Updated•2 years ago
|
Comment 6•2 years ago
|
||
bugherder |
Description
•