Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPII-4273iii LFM gets repository revision and computes URL to solutions registry therein #840

Open
wants to merge 93 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
44e0f86
GPII-4273: Working version of revision requester and its tests
klown Jan 21, 2020
06104ec
GPII-4273: Improved require statement to import GpiiRevisionRequeste…
klown Jan 21, 2020
1541231
GPII-4273: Fixed lint errors
klown Jan 22, 2020
1d92148
GPII-4273: Merged branch 'GPII-4273ii' into GPII-4273iii
klown Jan 22, 2020
81be7b4
GPII-4273: Improved specification of the URL members
klown Jan 23, 2020
0bb842d
GPII-4273: Added documentation for GpiiRevisionRequester's getRevision()
klown Jan 24, 2020
0f416fc
GPII-4273: LFM modified to run in development and production configur…
klown Jan 24, 2020
8902184
GPII-4273: (GPII-4273iii) Merged branch 'GPII-4273ii' into GPII-4273iii
klown Jan 27, 2020
a0c721f
GPII-4273: (GPII-4273iii) Fixed untrusted config files
klown Jan 28, 2020
52ed7cb
GPII-4273: (GPII-4273iii) Used platform reporter for the solutions re…
klown Jan 29, 2020
7a44636
GPII-4273: (GPII-4273iii) Merged from upstream master branch and 'GPI…
klown Jan 30, 2020
28b2cc4
GPII-4273: (GPII-4273iv) Added repositorySolutionsLoader component
klown Jan 31, 2020
76f6453
GPII-4273: (GPII-4273iv) Added more tests
klown Feb 4, 2020
9066f8f
GPII-4273: (GPII-4273iv) Fixed config file error, and typo in option…
klown Feb 4, 2020
c47f65a
GPII-4273: (GPII-4273iv) Added latest tests to "all-tests.js"
klown Feb 5, 2020
b07a486
GPII-4273: (GPII-4273iv) Added test checking writing solutions regist…
klown Feb 5, 2020
ce79b5b
GPII-4273: (GPII-4273iv) Removed writing of local solutions registry …
klown Feb 5, 2020
2fbacf7
GPII-4273: (GPII-4273iii) Removed cruft and improved function name
klown Feb 5, 2020
3a93c64
GPII-4273: (GPII-4273v) Merged changes from upstream GPII master branch
klown Feb 7, 2020
575797f
GPII-4273: (GPII-4273iii) Added solutions ID to solutions registry me…
klown Feb 7, 2020
97a9cee
GPII-4273: (GPII-4273iv) Repository solutions registry fetch part of…
klown Feb 10, 2020
b8d2743
GPII-4273: (GPII-4273iv) Debugging: removing some tests
klown Feb 10, 2020
013ccfc
GPII-4273: (GPII-4273iv) Handles failure to fetch repository solution…
klown Feb 11, 2020
d99c936
GPII-4273: (GPII-4273iv) Debugging: putting tests back
klown Feb 11, 2020
b460d5f
GPII-4273: (GPII-4273iv) Reworked flowManagerReady sequence
klown Feb 13, 2020
7c9763c
GPII-4273: (GPII-4273iv) Modified sequence leading up to flowManagerR…
klown Feb 13, 2020
c9813d6
GPII-4273: (GPII-4273iv) Reverted to flowManagerReady composite event…
klown Feb 14, 2020
beb6da6
GPII-4273: Fix the failing production config test for login/logout pr…
cindyli Feb 20, 2020
2feddda
GPII-4273: (GPII-4273iv/v) Refactored solutions registry data source
klown Feb 24, 2020
7ae3e54
GPII-4273: (GPII-4273iv/v) Merged branch 'GPII-4273ii' into GPII-4273iii
klown Feb 24, 2020
a4e87bb
GPII-4273: (GPII-4273iv/v) Fixed missing require
klown Feb 24, 2020
493b8e8
GPII-4273: (GPII-4273iv/v) Merged cindy's GPII-4273 changes into GPII…
klown Feb 24, 2020
9cbbc4a
GPII-4273: (GPII-4273iv/v) Removed old comment
klown Feb 24, 2020
86be6bf
GPII-4273: (GPII-4273iv/v) Different getImpl() depending on type of S…
klown Feb 25, 2020
afe4475
GPII-4273: (GPII-4273iv/v) Improved comments
klown Feb 25, 2020
dc8e7c9
GPII-4273: (GPII-4273iv) Incorporated Cindy's refactoring
klown Feb 27, 2020
ee2d432
GPII-4273: (GPII-4273iv) Modified to respect latest SolutionsRegistry…
klown Feb 27, 2020
bfaec91
GPII-4273: (GPII-4273iii) Merged changes from GPII-4273ii
klown Feb 28, 2020
22415f7
GPII-4273: (GPII-4273iv) Return the bare solutions when request is fo…
klown Mar 2, 2020
31839fe
GPII-4273: (GPII-4273iv) Removed tests for the startup API
klown Mar 4, 2020
fc065f6
GPII-4273: (GPII-4273iv) Merged changes from branch 'GPII-4273ii'
klown Mar 4, 2020
4ff02a0
GPII-4273: (GPII-4273iv) Merged CouchDB docker image version fix for …
klown Mar 4, 2020
1b15ec5
GPII-4273: (GPII-4273iv) Added tests for SolutionsRegistryDataSource
klown Mar 5, 2020
2e9e51b
GPII-4273: (GPII-4273iv) Waiting for solutions registry "ready" event…
klown Mar 6, 2020
44ff147
GPII-4273: (GPII-4273iv) Modified CBFM solutions registry tests
klown Mar 6, 2020
1dfa823
GPII-427333: (GPII-4273iv) Improved some test messages
klown Mar 9, 2020
8738df4
GPII-4273: (GPII-4273iv) Improved overlay code
klown Mar 9, 2020
62342c0
GPII-4273: (GPII-4273iv) Removed version of get() that retrieved the …
klown Mar 11, 2020
d058493
GPII-4273: (GPII-4273iii) Merged branch 'GPII-4273ii' into GPII-4273iii
klown Mar 12, 2020
fb8a3cf
GPII-4273: (GPII-4273iv) Used distributeOptions in config file for Ca…
klown Mar 12, 2020
33774c3
GPII-4273: (GPII-4273iv) Fixed lint error
klown Mar 12, 2020
58d31c1
GPII-4273: (GPII-4273iii) Distribute platformReporter into SolutionsR…
klown Mar 13, 2020
8b72c7e
GPII-4273: (GPII-4273iv) Updated based on Cindy's review comments
klown Mar 17, 2020
cf25187
GPII-4273: (GPII-4273iv) Addressed review comments for capture tests
klown Mar 17, 2020
1dafa91
GPII-4273: (GPII-4273iv) More changes to RepositorySolutionsLoader du…
klown Mar 17, 2020
9223344
GPII-4273: (GPII-4273iv) Modifications due to review comments
klown Mar 18, 2020
b59d2d3
GPII-4273: (GPII-4273iii) Merged branch GPII-4273ii, including chang…
klown Mar 18, 2020
71614d3
GPII-4273: (GPII-4273iv) Improved error message
klown Mar 19, 2020
c21ebf3
GPII-4273: (GPII-4273iv) Added documentation for the SolutionsRegistr…
klown Mar 19, 2020
634fa2f
GPII-4273: (GPII-4273iv) Improved check function in SolutionsRegistry…
klown Mar 20, 2020
a0b4abc
GPII-4273: (GPII-4273iv) Fixed lint errors, spelling, and grammar
klown Mar 20, 2020
d942849
GPII-4273: (GPII-4273iv) Modified configurations to squelch irreleva…
klown Mar 27, 2020
58afffa
GPII-4273: (GPII-4273iv) Another way to squelch irrelevant "FATAL" er…
klown Mar 31, 2020
f2f3904
GPII-4273: (GPII-4273iv) New configuration for revision requests
klown Apr 2, 2020
59bafa3
GPII-4273: (GPII-4273iv) Removed extra line
klown Apr 3, 2020
bc3cb7b
GPII-4273: Merged branch 'GPII-4273ii' into GPII-4273iii
klown Apr 3, 2020
65f4d86
GPII-4273: (GPII-4273iv) Address review comments
klown Apr 13, 2020
5507e83
GPII-4273: (GPII-4273iv) Addressed review comments
klown Apr 14, 2020
5611440
GPII-4273: (GPII-4273iv) More tweaking of configuration files
klown Apr 15, 2020
ffa5b06
GPII-4273: (GPII-4273iv) Better way to detect solutionsRegistryReady
klown Apr 15, 2020
77a36c5
GPII-4273: (GPII-4273iv) Fixed documentation
klown Apr 16, 2020
b0c0a1b
GPII-4273: (GPII-4273iv) Fixed documentation of configuration file
klown Apr 16, 2020
fe85739
GPII-4273: (GPII-4273iv) Fixed an url
klown Apr 16, 2020
088c077
GPII-4273: (GPII-4273iv) Adding production test of the SRDS loading s…
klown Apr 20, 2020
2ea71a8
GPII-4273: (GPII-4273iv) Re-ordering the production tests.
klown Apr 20, 2020
a98a543
GPII-4273: (GPII-4273iv) Moved load sequence tests back into all-test…
klown Apr 21, 2020
008c4bd
GPII-4273: (GPII-4273i) Modified technique for getting a revision
klown Apr 21, 2020
a5d316a
GPII-4273: (GPII-4273i) Fixed bug in getting revision
klown Apr 22, 2020
5418f50
GPII-4273: Fixed spelling
klown Apr 22, 2020
9eaccbc
GPII-4273: Merged branch GPII-4273ii into GPII-4273iii
klown Apr 22, 2020
308e3bb
GPII-4273: Merged branch 'GPII-4273ii' into GPII-4273iii
klown Apr 27, 2020
a4c8a02
GPII-4273: (GPII-4273iii) Removed accidentally commented out line
klown Apr 27, 2020
a93ae03
GPII-4273: (GPII-4273iii) Merged changes from branch 'GPII-4273ii'
klown Apr 30, 2020
f5ce552
GPII-4273: Merged branch 'GPII-4273ii' into GPII-4273iii
klown May 5, 2020
4ca4aaa
GPII-4273: Merged changes from upstream master GPII branch
klown May 7, 2020
04b713d
GPII-4273: Merged upstream master branch into GPII-4273iii
klown May 11, 2020
304a970
GPII-4273: Merged upstream master GPII branch
klown May 13, 2020
4e965cd
GPII-4273: Merged changed from upstream master GPII branch
klown May 19, 2020
1a4f0ef
GPII-4273: Merged changes from upstream master universal branch
klown May 29, 2020
dca6660
GPII-4273: Merged remote-tracking master GPII branch into GPII-4273iii
klown Jun 8, 2020
76e8c35
GPII-4273: (GPII-4273iii) Merged universal's master branch into GPII-…
klown Jun 16, 2020
c61e6c8
Merge upstream master GPII branch into GPII-4273iii
klown Jun 22, 2020
d5cc898
Merged upstream master GPII branch into GPII-4273iii
klown Jun 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions documentation/Configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,18 @@ for the reset API and how to use it.
**Purpose**: This config fetches default settings from a remote URL. The default URL is set to
`https://raw.githubusercontent.com/GPII/universal/master/testData/defaultSettings/defaultSettings.win32.json5`
in this config. See [Reset Computer](ResetComputer.md) for what are default settings.

### Load Solutions from the Repository in Production Contexts

**Config file**: [`%flowManager/configs/gpii.config.local.flowManager.loadSolutionsFromRepository.json5`](../gpii/node_modules/flowManager/configs/gpii.config.local.flowManager.loadSolutionsFromRepository.json5)

**Purpose**: This add-on config is for use in production where the cloud based
flow manager supports a valid `/revision` end point, and where the local
flow manager loads solutions registries from both its local hard drive and from
the source code repository. See [SolutionsRegistryDataSource](SolutionsRegistryDataSource.md#local-flow-manager-solutions-registry-data-source)
for more details.

In addition, for development testing, the default is to assume there is no valid
revision, and no request for the revision is made (see [GpiiRevisionRequester.js](../gpii/node_modules/flowManager/src/GpiiRevisionRequester.js)).
This is done by setting the requester's `cloudURL` option to `null`. This
effectively stops the process of loading solutions from the repository.
14 changes: 11 additions & 3 deletions documentation/FlowManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,19 @@ payload structure to start a matchMaking process.
cloud based components of the GPII.
* **route:** `/revision`
* **method:** `GET`
* **return:** A JSON document containing the revision:
* **return:** On success, an http status code of 200 and a payload containing the revision, e.g.:

```json
```json5
{"sha256": "2602bdf868aec49993d8780feec42d4e9f995e21"}
```

Otherwise, returns status code 404 and an error payload:

```json5
{
"sha256": "2602bdf868aec49993d8780feec42d4e9f995e21"
"isError": true,
"message": "Error retrieving full git revision: %reason",
"statusCode": 404
}
```

Expand Down
134 changes: 134 additions & 0 deletions documentation/SolutionsRegistryDataSource.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Solutions Registry Data Source

The solutions registry data source provides a RESTful means of fetching
solutions registries via the [FlowManager](FlowManager.md) in order to determine
which solutions are available and appropriate for a user's preferences. A
solution is an application, such as the NVDA screen reader, or an operating
system feature set using a control panel, such as the Windows high contrast
theme. Each solution entry in the registry declares a set of preferences that
it supports and describes how to configure the solution, launch it, reset it,
and stop it.

The solutions are listed in `JSON` files called "solutions registries". The
structure of a solutions registry is documented in
[SolutionsRegistryFormat](SolutionsRegistryFormat.md). Since solutions are
frequently specific to an operating system, or "platform", there are separate
solution registries for each platform. Examples of platforms are Windows,
GNOME-Linux, MacOS, and Android.

The SolutionsRegistryDataSource is a component that loads and caches
solutions registries when the GPII starts up, and then serves solutions to the
rest of the system upon request. The flow manager coordinates retrieval of
solutions, user preferences, device information, and so on, passing these to the
[MatchMaker Framework](MatchMakerFramework.md) and [LifecycleManager](LifecycleManager.md).

There are two initialization workflows with respect to solutions registries
depending on whether the flow manager is running in the cloud or locally on the
client device. The Cloud Based Flow Manager uses a Solutions Registry Data
Source implemented to run in that context, whereas the Local Flow Manager uses a
Solutions Registry Data Source appropriate for running on client machines.
These two scenarios are described in the following two sections.

## Cloud Based Flow Manager Solutions Registry Data Source

With respect to the Cloud Based Flow Manager, the solutions registries are
included in the distribution of `gpii-universal` along with the other components
of the GPII -- the flow manager, lifecycle manager and so on. The Cloud Based
FlowManager is a central service for GPII clients, and these clients run on a
variety of platforms. As such, the platform that the Cloud Based FlowManager is
executing on is irrelevant in terms of providing solutions for the client. When
a request for a solutionsvregistry is made, the flow manager needs to have
access to all platform solutions in order to respond with the solutions relevant
to a particular client.

Here, the SolutionsRegistryDataSource component loads the solutions
registries from the local file system at system startup. In this context,
"local" refers to the file system associated with machine that the Cloud Based
Flow Manager is running on. The SolutionsRegistryDataSource is a
subcomponent of the flow manager, and the sequence of operations and
events that occur during its instantiation are:

<ol>
<li><code>loadSolutions.loadFromLocalDisk</code>,
<ul>
<li>The solutions registry files are loaded from the local file system,</li>
</ul>
</li>
<li><code>loadSolutions.solutionsLoaded</code>
<ul>
<li>Fires a <code>solutionsRegistryReady</code> event.</li>
</ul>
</li>
</ol>

The `solutionsRegistryReady` informs the flow manager that its
SolutionsRegistryDataSource is ready to provide solutions upon request.

## Local Flow Manager Solutions Registry Data Source

As in the case of the Cloud Based FlowManager, the solutions registries are
included in the distribution of GPII for the client. However, they are not
updated as frequently as those in the cloud. In particular, the solutions
registry may be stale for the platform that the client is running on. However,
the registry associated with the latest version of the cloud based GPII is
available in `gpii-universal`'s source code repository (github), and can be
downloaded from there. In this regard, the Cloud Based FlowManager provides a
`/revision` end-point that responds with the full `SHA256` of the revision of
the source associated with the latest solutions registries.

The SolutionsRegistryDataSource associated with the Local FlowManager uses the
following sequence of events and operations at startup:

<ol>
<li><code>loadSolutions.loadFromLocalDisk</code>,
<ul>
<li>The solutions registry files are loaded from the local file system,</li>
</ul>
</li>
<li><code>loadSolutions.getRevision</code>,
<ul>
<li>Make an http request of the Cloud Based FlowManager for the revision of
the source code of the GPII used by the cloud,
</li>
</ul>
</li>
<li><code>loadSolutions.loadFromRepository</code>,
<ul>
<li>Make an http request of the source code respository, passing:
<ul>
<li>the platform ID associated with the OS that the client is running on,
e.g. "darwin",
</li>
<li>the revision fetched at the previous step,</li>
</ul>
</li>
<li>The solutions registry corresponding to the platform and revision provided
is downloaded from the source code repository and overlays the one fetched
from the local file system at the first step.
</li>
</ul>
</li>
<li><code>loadSolutions.solutionsLoaded</code>
<ul>
<li>Fires a <code>solutionsRegistryReady</code> event</li>
</ul>
</li>
</ol>

The above sequence is embeded within the Local FlowManager's `flowManagerReady`
startup interlock such that all initialization is completed before the GPII
client responds to user interactions.

Note that both the `getRevision` and/or the `loadFromRepository` steps could
fail. In that case, the latest solutions registry for the client platform will
not be downloaded and cached within the client. When solutions for the client
platform are requested, the SolutionsRegistryDataSource uses a fallback where
the solutions loaded from the local file system during the first
`loadFromLocalDisk` step are provided.

Further note that the `getRevision` step feeds its result into the
`loadFromRepository` step. The revision is necessary to fetch the
correct solutions registry from the repository. If a developer wants to avoid
that, they can set the `cloudURL` of the `GpiiRevisionRequester` to `null`,
effectively stopping the entire sequence. No solutions registry will be
downloaded from the repository in that case.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 17 additions & 3 deletions gpii/node_modules/flowManager/src/FlowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ require("gpii-user-errors");
fluid.defaults("gpii.flowManager", {
gradeNames: ["kettle.app"],
components: {
// TODO: Make this use the solutions registry data source by default?
solutionsRegistryDataSource: {
type: "kettle.dataSource",
type: "gpii.flowManager.solutionsRegistry.dataSource.cloudBased",
options: {
termMap: {
"os": "%os",
Expand Down Expand Up @@ -154,9 +153,23 @@ fluid.defaults("gpii.flowManager.local", {
"lifecycleManager.pspChannel.sessionBinder": {
record: "gpii.pspChannel.sessionBinder",
target: "{that lifecycleManager gpii.lifecycleManager.userSession}.options.gradeNames"
},
"solutionsRegistryDataSource.platformReporter": {
record: {
platformReporter: "{gpii.flowManager.local}.deviceReporter.platformReporter"
},
target: "{that solutionsRegistryDataSource}.options.components"
}
},
components: {
solutionsRegistryDataSource: {
type: "gpii.flowManager.solutionsRegistry.dataSource.local",
options: {
events: {
solutionsRegistryReady: "{gpii.flowManager.local}.events.solutionsRegistryReady"
}
}
},
lifecycleManager: {
type: "gpii.lifecycleManager",
options: {
Expand Down Expand Up @@ -222,10 +235,12 @@ fluid.defaults("gpii.flowManager.local", {
preferencesSavedSuccess: null,
preferencesSavedError: null,
noUserLoggedIn: null,
solutionsRegistryReady: null,
getDefaultSettingsData: null,
defaultSettingsDataLoaded: null,
flowManagerReady: {
events: {
"solutionsRegistryReady": "solutionsRegistryReady",
"defaultSettingsDataLoaded": "defaultSettingsDataLoaded",
"kettleReady": "{kettle.server}.events.onListen"
}
Expand All @@ -242,7 +257,6 @@ fluid.defaults("gpii.flowManager.local", {
funcName: "gpii.flowManager.local.mountWebSocketsSettingsHandler",
args: ["{webSocketsSettingsHandlerComponent}"]
},

// Fire "getDefaultSettingsData" event to trigger promise transform chain that does:
// 1. Read default settings from the reset to default file;
// 2. Calculate defaultLifecycleInstructions and defaultSnapshot based on the default settings;
Expand Down
79 changes: 79 additions & 0 deletions gpii/node_modules/flowManager/src/GpiiRevisionRequester.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*!
GPII Full SHA Revision DataSource

Copyright 2020 OCAD University

Licensed under the New BSD license. You may not use this file except in
compliance with this License.

You may obtain a copy of the License at
https://github.com/GPII/universal/blob/master/LICENSE.txt
*/

"use strict";

var fluid = require("infusion"),
gpii = fluid.registerNamespace("gpii");

require("kettle");

fluid.registerNamespace("gpii.flowmanager.revisionRequester");

fluid.defaults("gpii.flowmanager.revisionRequester", {
Copy link
Contributor

@cindyli cindyli Feb 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component can be replaced by the subcomponent gpiiRevisionDataSource and provides a get() API.

gradeNames: ["fluid.component"],

// Prepend CBFM host/port distributed down from, e.g., gpii.flowManager.config.untrusted
// For development tests where there is no valid /revision endpoint in the
// cloud, this is left as null.
cloudURL: null,
urlTemplate: "%cloudURL/revision",

// Compute url from CBFM base URL and template
revisionGetUrl: {
expander: {
funcName: "fluid.stringTemplate",
args: ["{that}.options.urlTemplate", {
cloudURL: "{that}.options.cloudURL"
}]
}
},
components: {
gpiiRevisionDataSource: {
type: "kettle.dataSource.URL",
options: {
url: "{revisionRequester}.options.revisionGetUrl"
}
}
},
invokers: {
getRevision: {
funcName: "gpii.flowmanager.revisionRequester.getRevision",
args: ["{that}"]
}
}
});

/**
* Retrieve the respository revision's full SHA256 from the cloud.
* @param {Component} that - An instance of gpii.flowManager.revisionRequester.
* @return {Promise} A promise whose resolved value is eiher the revision or, if
* there is an error, an object with an "isError: true" property. The revision
* has the form { "sha256": "86a83d2f93a6f8f954a4fef618ca6aea1399c980" }.
*/
gpii.flowmanager.revisionRequester.getRevision = function (that) {
var togo = fluid.promise();
if (that.options.cloudURL !== null) {
var revisionPromise = that.gpiiRevisionDataSource.get();
revisionPromise.then(function (/*revision*/) {
fluid.promise.follow(revisionPromise, togo);
}, function (err) {
togo.resolve(err);
});
} else {
// If the url to the CBFM is null, assume this is running in a
// development testing enviroment or, generally, a scenario where
// requests for the revision are to be suppressed.
togo.resolve(null);
}
return togo;
};
16 changes: 6 additions & 10 deletions gpii/node_modules/flowManager/src/MatchMaking.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,22 @@
gpii.flowManager.getSolutions = function (solutionsRegistryDataSource, deviceContext, onSuccessEvent, onErrorEvent) {
var promiseTogo = fluid.promise();

var os = fluid.get(deviceContext, "OS.id");
var promise = solutionsRegistryDataSource.get({});
promise.then(function (solutions) {
var solutionsRegistryEntries = gpii.matchMakerFramework.filterSolutions(solutions[os], deviceContext);
var promise = solutionsRegistryDataSource.get({os: fluid.get(deviceContext, "OS.id")});
promise.then(function (entries) {
var solutionsRegistryEntries = gpii.matchMakerFramework.filterSolutions(entries, deviceContext);
fluid.log("Fetched filtered solutions registry entries: ", gpii.renderMegapayload({solutionsRegistryEntries: solutionsRegistryEntries}));
promiseTogo.resolve({
solutionsRegistryEntries: solutionsRegistryEntries,
solutions: solutions
solutionsRegistryEntries: solutionsRegistryEntries
});
if (onSuccessEvent) {
onSuccessEvent.fire(solutionsRegistryEntries, solutions);
onSuccessEvent.fire(solutionsRegistryEntries);
}
}, function (error) {
promiseTogo.reject(error);
if (onErrorEvent) {
onErrorEvent.fire(error);
}
});

return promiseTogo;
};

Expand Down Expand Up @@ -187,8 +184,7 @@
gpiiKey: "{that}.gpiiKey",
preferences: "{arguments}.preferences.0",
deviceContext: "{arguments}.deviceContext.0",
solutionsRegistryEntries: "{arguments}.solutions.0",
fullSolutionsRegistry: "{arguments}.solutions.1"
solutionsRegistryEntries: "{arguments}.solutions.0"
}]
}
},
Expand Down
Loading