Closed
Bug 685045
Opened 15 years ago
Closed 10 years ago
Port TP async filter function to mobile version
Categories
(Mozilla Labs Graveyard :: Test Pilot, defect)
Mozilla Labs Graveyard
Test Pilot
Tracking
(Not tracked)
RESOLVED
WONTFIX
1.3
People
(Reporter: jono, Unassigned)
Details
(Whiteboard: mobile, api)
Attachments
(1 file, 1 obsolete file)
|
11.83 KB,
patch
|
Details | Diff | Splinter Review |
Specifically this is to enable the Firebug survey, which needs a filter function that checks if the user has Firebug installed. Checking for an extension is an asynchronous API, so we either have to block on it (bad) or rewrite the test pilot extension <-> study API to be async as well. (This will also enable us to use other async APIs in filter functions in the future.)
For backwards compatibility between studies and old TP versions, I gave the new async function the name "filter" instead of the old name "runOrNotFunc". A study can thus implement both.
Attachment #558687 -
Flags: review?(gavin.sharp)
Comment 2•15 years ago
|
||
Comment on attachment 558687 [details] [diff] [review]
Patch making the API asynchronous
>diff --git a/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js b/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js
>+ _checkExperimentRequirements: function TPS__requirementsMet(experiment, callback) {
>+ let numExperiments = [filename for (filename in experiments)].length;
Object.keys(experiments).length?
>+ numExperimentsProcessed ++;
>+ if (numExperimentsProcessed == numExperiments) {
If a poorly written study fails to call the callback, this code will never run. That seems like it could be problematic - the old code would catch such issues with a try/catch. I guess there isn't much that can be done about that short of setting up a watchdog timer. Perhaps that's overkill?
So, do you want me to write a watchdog timer, or can we just say that every study needs to call the callback 100% of the time and leave it at that?
Comment 4•15 years ago
|
||
I was looking for your thoughts, since you know how studies are written and deployed (and by whom), and what the likelihood of this posing a problem in practice is. If you don't think it's necessary, that's fine by me.
Took your suggestion for a cleaner way to count the number of keys.
I'm not going to set up a watchdog, though; it will just make things a lot more complicated (as we have to worry about the case where the watchdog triggers but then the original study calls back after all, meaning the callback will be called twice.
Instead, it must be up to the study to ensure that the filter function is guaranteed to be called. I think I can handle that in the server-side base classes used by all studies.
Attachment #558687 -
Attachment is obsolete: true
Attachment #558687 -
Flags: review?(gavin.sharp)
Attachment #563856 -
Flags: review?(gavin.sharp)
Updated•15 years ago
|
Attachment #563856 -
Flags: review?(gavin.sharp)
Done on desktop.
Needs to be ported to mobile for v 1.3.
Whiteboard: mobile, api
Target Milestone: 1.2 → 1.3
Summary: Test Pilot API - filter function needs to be asynchronous → Port TP async filter function to mobile version
| Assignee | ||
Updated•10 years ago
|
Product: Mozilla Labs → Mozilla Labs Graveyard
Comment 7•10 years ago
|
||
decommissioned
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•