Phuedx has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351605 )

Change subject: eventLogging: Add missing perceivedWait property
......................................................................

eventLogging: Add missing perceivedWait property

Per the Popups schema [0], the "dismissed" action expects the
perceivedWait property to be set.

Happily, the time until the preview was shown is already recorded and
used to determine whether or not to create a "dismissed" or
"dwelledButAbandoned" event.

Reducer changes:
* When creating the "dismissed" event, set the perceivedWait property to
  the already accumulated timeToPreviewShow.

[0] https://meta.wikimedia.org/wiki/Schema:Popups

Change-Id: I3fd253f1c2ff5fa8e24c9225060d728ffd8dfd27
---
M src/reducers/eventLogging.js
M tests/node-qunit/reducers/eventLogging.test.js
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups 
refs/changes/05/351605/1

diff --git a/src/reducers/eventLogging.js b/src/reducers/eventLogging.js
index 6741d27..8717dfd 100644
--- a/src/reducers/eventLogging.js
+++ b/src/reducers/eventLogging.js
@@ -59,6 +59,7 @@
        if ( interaction.timeToPreviewShow !== undefined ) {
                result.action = 'dismissed';
                result.previewType = interaction.previewType;
+               result.perceivedWait = interaction.timeToPreviewShow;
        } else {
                result.action = 'dwelledButAbandoned';
        }
diff --git a/tests/node-qunit/reducers/eventLogging.test.js 
b/tests/node-qunit/reducers/eventLogging.test.js
index 0184c2a..8cff446 100644
--- a/tests/node-qunit/reducers/eventLogging.test.js
+++ b/tests/node-qunit/reducers/eventLogging.test.js
@@ -568,7 +568,9 @@
                        action: 'dismissed',
 
                        // N.B. that the FETCH_* actions have been skipped.
-                       previewType: undefined
+                       previewType: undefined,
+
+                       perceivedWait: 700
                },
                'It should enqueue a "dismissed" event when the preview has 
been shown.'
        );

-- 
To view, visit https://gerrit.wikimedia.org/r/351605
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3fd253f1c2ff5fa8e24c9225060d728ffd8dfd27
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to