As long as Price Tracker is still listed on AMO, it's possible for users to install Price Tracker after the update is published, and those users should receive the retirement notice as well.
Though the same page is used, a query string is passed via the url for the page to indicate if it has been opened as the final notice. This modifies the header and one sentence in the first paragraph to indicate the extension will self-uninstall in one day.
* Using the web extension 'storage.local' API, store the date of the last update, when the first notice was shown.
* Each subsequent startup, check if 30 or more days have passed since the first notice was shown.
* If so, show a final notice and store the date that the final notice was shown.
* Each subsequent startup, check if 1 or more days have passed since the final notice was shown.
* If so, uninstall the extension.
This logic can be tested by making use of two new config override prefs by adding them to 'web-ext-config.js', e.g. (replace AT with @):
* 'extensions.shopping-testpilotATmozilla.org.initialNoticeDuration=10'
* Sets the period between the initial and final retirement notice to 10 seconds.
* 'extensions.shopping-testpilotATmozilla.org.finalNoticeDuration=10'
* Sets the period between the final retirement notice and self-uninstall to 10 seconds.
With updated vectors for 'title' and 'price' features based on the optimized coefficients and bias for 'image', the 'title' and 'price' features were trained using 'fathom-train' and their coefficients and biases updated.
In Price Tracker, the product 'title' and 'price' features are dependent upon the 'image' feature results (e.g. there is a rule for the 'price' feature called 'isNearImage' which scores a candidate 'price' element based on its proximity to the most likely 'image' element).
As a result, the final weights and bias from training the 'image' feature need to be taken into account before vectorizing the 'title' and 'price' features. This commit updates the vectors for 'title' and 'price' to take this into account.
After fixing the issue with a 'null' feature vector value in the price vectors, the vectors were re-generated using FathomFox's Vectorizer. Now there are no longer any 'null' feature vector values and training can proceed.
As mentioned in [this issue](https://github.com/mozilla/fathom-fox/issues/35), it's possible that a feature vector will contain a 'null' value for one or more rules, which will cause 'fathom-train' to throw an error.
In this case, the reason for the 'null' value was a name mismatch.
I opted to change the method name as its naming convention did not match the other rules.
Previous vectors were based on an incomplete corpus of tagged product pages. These vectors are based on the complete set of Amazon, Ebay, Best Buy, Walmart and Home Depot samples tagged in the [Fathom Commerce Samples](https://drive.google.com/drive/folders/1YKfDHx2niy9nCrdKCSDt7lcU9uWbHzon) folder.
These samples were divided into 3 buckets using ['fathom-pick'](https://github.com/mozilla/fathom/blob/master/cli/fathom_web/pick.py): training, validation and test set, which moves samples at random. The split percentage for the complete corpus into these buckets was 80/10/10.
Sometimes a feature vector can output a 'null' value. This will [throw an error](https://github.com/mozilla/fathom-fox/issues/35) during training with the new 'fathom-train' CLI.
Possible causes include:
* A name mismatch between the 'name' value passed into a rule function (its second argument) and the name of the rule in the list of [ruleName, coefficient] tuples referenced in the ruleset object.
* A score callback might be failing to return a number.
* A corner case of a DOM or CSSOM specification used by a score callback; e.g. innerText could return null instead of the empty string in Firefox.
In this case, a score callback was failing to return a number if the width or height of the element passed into 'aspectRatio' was 0.
Training with Fathom 3.0 requires some changes to the structure of the coefficients and ruleset used and has a new vectorize step.
Fathom changes include:
* Fathom now handles weighting the rules by their coefficients.
* Rule weighting is no longer exponential.
* Each rule should return a value between 0 and 1, inclusive
* Coefficients should be passed into Fathom as a [rule_name, coefficient] tuple
* Fathom's 'rule' function now takes a second argument, an object literal with a single key, 'name'. Its value is the name of the rule. This string literal value must match the rule_name passed into Fathom as part of the tuple mentioned above.
* [Fathom training](http://mozilla.github.io/fathom/training.html?highlight=vectorizer#running-the-trainer) now includes a vectorize step using the Vectorizer in FathomFox
* The Vectorizer generates a 'vectors.json' file for training and validation for each feature (for Price Tracker which has three features (the product image, title and price), this would be 6 new files).
* The main purpose of each 'vectors.json' file is to provide a 'feature' vector for each candidate element for a given feature. This feature vector has a floating point value for each rule. The ith value corresponds to the raw score for that element for the ith rule passed into Fathom for that feature's list of [rule_name, coefficient] tuples.
Hopefully this will help manage folks' expectations regarding bugs, feature requests, etc.
This is a better solution than to archive the project, since it is still possible it will be worked on some time in the future.
Find and replace all instances of "Price Wise", "price-wise" and "price_wise" (case insensitive) with the following exceptions:
* The telemetry event category, 'extension.price_wise' for continuity.
* The survey URLs (for [feedback](https://qsurvey.mozilla.com/s3/price-wise) linked to in the popup and the now flagged off [UR study](https://qsurvey.mozilla.com/s3/Price-Wise-Research-Study)).
Note: Updating the name of the project in `package.json` and calling `npm install` also triggered adding an additional [`optional`](https://docs.npmjs.com/files/package-lock.json#optional) key in `package-lock.json` for some devDeps.