From 25707466074419674c4efba7d3634c4d2242f679 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 15 Oct 2024 16:24:40 +0530 Subject: [PATCH 01/20] sanity ui changes --- src/FireboltTransportInvoker.js | 19 +++++++++++++++++-- src/MenuBuilder.js | 2 +- src/MethodFilters.js | 5 ++++- src/constant.js | 2 ++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/FireboltTransportInvoker.js b/src/FireboltTransportInvoker.js index 9501fd7d..3001200d 100644 --- a/src/FireboltTransportInvoker.js +++ b/src/FireboltTransportInvoker.js @@ -17,6 +17,15 @@ */ import Transport from '@firebolt-js/sdk/dist/lib/Transport'; +import { CONSTANTS } from './constant'; + +let invokeManager, invokeProvider; +try { + invokeManager = require('../plugins/FireboltExtensionInvoker').default.invokeManager; + invokeProvider = require('../plugins/FireboltExtensionInvoker').default.invokeProvider; +} catch (err) { + logger.error(`Unable to import additional invoker - ${err.message}`); +} let instance = null; @@ -32,7 +41,7 @@ export default class FireboltTransportInvoker { return instance; } - async invoke(methodName, params, paramNamesArray) { + async invoke(methodName, params, paramNamesArray, invoker = null) { const module = methodName.split('.')[0]; const method = methodName.split('.')[1]; if (paramNamesArray) { @@ -42,7 +51,13 @@ export default class FireboltTransportInvoker { // For each param, construct json using param name and value jsonParams[paramNamesArray[i]] = params[i]; } - return await Transport.send(module, method, jsonParams); + if (invoker == CONSTANTS.INVOKEPROVIDER) { + return await invokeProvider.send(module, method, jsonParams); + } else if (invoker == CONSTANTS.INVOKEMANAGER) { + return await invokeManager.send(module, method, jsonParams); + } else { + return await Transport.send(module, method, jsonParams); + } } else { throw Error('Could not find params for ' + methodName); } diff --git a/src/MenuBuilder.js b/src/MenuBuilder.js index c17fcf31..a650bb44 100644 --- a/src/MenuBuilder.js +++ b/src/MenuBuilder.js @@ -177,7 +177,7 @@ export default class MenuBuilder { function (sdkObject) { const sdkObjectCopy = { ...sdkObject }; // dynamically construct menu items using additionalSDKs config - const menuObject = this.createSubMenuObject(sdkObjectCopy.name, ValidationView, sdkObjectCopy.name, CONSTANTS.SDK); + const menuObject = this.createSubMenuObject(sdkObjectCopy.name, ValidationView, sdkObjectCopy.name, CONSTANTS.TRANSPORT); transportMenuArray.push(menuObject); }.bind(this) ); diff --git a/src/MethodFilters.js b/src/MethodFilters.js index af715890..696a64bb 100644 --- a/src/MethodFilters.js +++ b/src/MethodFilters.js @@ -38,7 +38,10 @@ export default class MethodFilters { isRpcMethod(method, invokedSdk, communicationMode = 'sdk') { let isRpc = false; - if ((invokedSdk == CONSTANTS.CORE.toLowerCase() || invokedSdk == CONSTANTS.MANAGE.toLowerCase()) && communicationMode == CONSTANTS.TRANSPORT) { + + const mergedSDKs = CONSTANTS.defaultSDKs.concat(CONSTANTS.additionalSDKs); + const sdkNames = mergedSDKs.map((sdkObjectCopy) => sdkObjectCopy.name.toLowerCase()); + if (sdkNames.includes(invokedSdk.toLowerCase()) && communicationMode == CONSTANTS.TRANSPORT) { return isRpc; } else if (invokedSdk == CONSTANTS.MANAGE.toLowerCase() && method.name.split('.')[1].startsWith('set')) { return isRpc; diff --git a/src/constant.js b/src/constant.js index dbc62c97..396cd0ee 100644 --- a/src/constant.js +++ b/src/constant.js @@ -141,6 +141,8 @@ export const CONSTANTS = { EXCLUDED_METHODS_FOR_SDK: [], EXCLUDED_METHODS_FOR_TRANSPORT: [], REGISTERPROVIDER: 'registerprovider', + INVOKEPROVIDER: 'invokeProvider', + INVOKEMANAGER: 'invokeManager', defaultSDKs: [ { name: 'Core', From c3bdf30768e74bfdf524cb0a4cef07e09e4a1032 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 23 Oct 2024 16:54:10 +0530 Subject: [PATCH 02/20] sat change --- src/App.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/App.js b/src/App.js index c0f5ba24..f0513ffb 100644 --- a/src/App.js +++ b/src/App.js @@ -391,6 +391,9 @@ export default class App extends Base { if (lifecycle_validationString == true) { process.env.LIFECYCLE_VALIDATION = 'true'; } + if (query.params.pubSubToken) { + process.env.PUBSUB_TOKEN = query.params.pubSubToken; + } process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST; From a13eadd6d877ec6eca7dcc04f83186e2ee5acc14 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 24 Oct 2024 14:05:52 +0530 Subject: [PATCH 03/20] formatting change --- src/App.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.js b/src/App.js index f0513ffb..ecea3732 100644 --- a/src/App.js +++ b/src/App.js @@ -391,10 +391,6 @@ export default class App extends Base { if (lifecycle_validationString == true) { process.env.LIFECYCLE_VALIDATION = 'true'; } - if (query.params.pubSubToken) { - process.env.PUBSUB_TOKEN = query.params.pubSubToken; - } - process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST; try { @@ -430,6 +426,10 @@ export default class App extends Base { if (query.params.pubSubUrl) { process.env.PUB_SUB_URL = query.params.pubSubUrl; } + // Set the pubSub token if present + if (query.params.pubSubToken) { + process.env.PUB_SUB_TOKEN = query.params.pubSubToken; + } if (query.task) { setTimeout(() => { From d0c13961e6d04945ea172e1d79fe7643b9c7b278 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 25 Oct 2024 13:31:50 +0530 Subject: [PATCH 04/20] added debug logs --- src/App.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.js b/src/App.js index ecea3732..e6b144f6 100644 --- a/src/App.js +++ b/src/App.js @@ -423,12 +423,17 @@ export default class App extends Base { } // Set the pubSub URL if present + console.log('2507 test log - query param', query.params); + console.log('2507 test log - query param pubsuburl', query.params.pubSubUrl); if (query.params.pubSubUrl) { process.env.PUB_SUB_URL = query.params.pubSubUrl; + console.log('2507 test log - process env pubsuburl', process.env.PUB_SUB_URL); } // Set the pubSub token if present + console.log('2507 test log - query param pubsubtoken', query.params.pubSubToken); if (query.params.pubSubToken) { process.env.PUB_SUB_TOKEN = query.params.pubSubToken; + console.log('2507 test log - process env pubsubtoken', process.env.PUB_SUB_TOKEN); } if (query.task) { From 0d5b41f0bd4cb4906acc2ffdd8a010e50278f79c Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 28 Oct 2024 11:13:45 +0530 Subject: [PATCH 05/20] navigate to changes --- src/LifeCycleHistory.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/LifeCycleHistory.js b/src/LifeCycleHistory.js index c16d1dbd..2da8132d 100644 --- a/src/LifeCycleHistory.js +++ b/src/LifeCycleHistory.js @@ -115,6 +115,9 @@ export default class LifecycleHistory { process.env.CURRENT_APPID = query.params.appId; process.env.MACADDRESS = query.params.macaddress; process.env.TEST_TOKEN = query.params.testtoken; + console.log('2507 test log - query param pubsubtoken discovery navigate', query.params.pubSubToken); + process.env.PUB_SUB_TOKEN = query.params.pubSubToken; + console.log('2507 test log - process env pubsubtoken discovery navigate', process.env.PUB_SUB_TOKEN); const pubSubListenerCreation = new PubSubCommunication(); const webSocketConnection = await pubSubListenerCreation.startWebSocket(); } From efa81bab004ed4270590cf36539841f3b130bcb8 Mon Sep 17 00:00:00 2001 From: anjali <47880722+anjalimukundan@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:17:05 +0530 Subject: [PATCH 06/20] Streamline dependencies on pubsub (#230) * Streamline dependencies on pub sub * fixed lint issues * fixed lint issues * updated default_mac logic * fixed lint issues * pubsub suffix changes * lint errors * remove console logs * minor correction * addig console logs * fix lint error * remove logs * remove default mac from app.js * updated mac address env * fix lint error * update readme with supported intent params * update readme * minor correction * updated mac address env * update url params * Updating readme --------- Co-authored-by: neeradanelxsi <148241508+neeradanelxsi@users.noreply.github.com> Co-authored-by: preethi.m Co-authored-by: neeradanelxsi --- README.md | 62 ++++++++++++++++++++++++++++++++------------- src/App.js | 12 ++++++++- src/constant.js | 2 ++ src/pubSubClient.js | 4 +-- src/utils/Utils.js | 10 +++++--- 5 files changed, 67 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 50bed960..35e7c28e 100644 --- a/README.md +++ b/README.md @@ -13,23 +13,25 @@ It has the following features - ## Table of Contents -- [Brief overview](#brief-overview) -- [Setup](#setup) - - [FCA URL deployed and available in the S3](#fca-url-deployed-and-available-in-the-s3) - - [Below are the steps to run FCA in local system](#below-are-the-steps-to-run-fca-in-local-system) -- [Supported ways of Execution](#supported-ways-of-execution) -- [Sanity Suite Flow](./docs/index.md) -- [Supported targets](#supported-targets) -- [Supported Modes of execution](#supported-modes-of-execution) -- [Supported validations](#supported-validations) -- [Supported ways of retrieving reports](#supported-ways-of-retrieving-reports) -- [Supported Report Parameters](#supported-report-parameters) -- [PR and merge process](#pr-and-merge-process) -- [Supported URL parameters](#supported-url-parameters) -- [Supported PubSub Handlers](#supported-pubsub-handlers) -- [Plugins](#plugins) -- [Connect to mock Firebolt OS](#connect-to-mock-firebolt-os) - - [Timeout in UI prompt](#timeout-in-ui-prompt) +- [firebolt-certification-app](#firebolt-certification-app) + - [Brief overview](#brief-overview) + - [Table of Contents](#table-of-contents) + - [Setup](#setup) + - [FCA URL deployed and available in the S3](#fca-url-deployed-and-available-in-the-s3) + - [Below are the steps to run FCA in local system](#below-are-the-steps-to-run-fca-in-local-system) + - [Supported ways of Execution](#supported-ways-of-execution) + - [Supported targets](#supported-targets) + - [Supported Modes of execution](#supported-modes-of-execution) + - [Supported validations](#supported-validations) + - [Supported ways of retrieving reports](#supported-ways-of-retrieving-reports) + - [Supported Report Parameters](#supported-report-parameters) + - [PR and merge process](#pr-and-merge-process) + - [Supported URL parameters](#supported-url-parameters) + - [Supported Intent Parameters](#supported-intent-parameters) + - [Supported PubSub Handlers](#supported-pubsub-handlers) + - [Plugins](#plugins) + - [Connect to mock Firebolt OS](#connect-to-mock-firebolt-os) + - [Timeout in UI prompt](#timeout-in-ui-prompt) ## Setup @@ -113,6 +115,32 @@ Mode of execution implies the way in which an API is invoked. There are 2 modes - If FCA systemui=true, FCA acts as the base app in case of ripple. The background color will be changed to purple and it will display one more button as "Launch FCA app" to launch FCA as third-party app on Ripple devices. - TestContext: testContext=true - If testContext=true, it will add the field context in mocha report generated +- AppId: appId=`` + - `appId` used to launch the app. +- Mac Address: macAddress=`` + - `macAddress` of the device running the tests. +- appType: appType=`` + - `appType` is the type of app being launched. +- Pub Sub Subscribe suffix : pubSubSubscribeSuffix=`` + - `pubSubSubscribeSuffix` is the subscribe suffix value used for Pub Sub communication. +- Pub Sub Publish suffix : pubSubPublishSuffix=`` + - `pubSubPublishSuffix` is the publish suffix value used for Pub Sub communication. + +## Supported Intent Parameters +- appType: + - Classifier for the app - Launch the certification app for certification validations. Launching a firebolt app for app certification. +- appId: + - When `appId` is specified in the intent, it will be used to launch the app. +- macAddress: + - When `macAddress` is specified in the intent, it indicates the mac address of the device running the tests. +- PubSub Publish Suffix: + - When `pubSubPublishSuffix` is specified in the intent, it publishes to the topic. +- PubSub Subscribe Suffix: + - When `pubSubSubscribeSuffix` is specified in the intent, it subscribes to the topic. +- pubSubUrl: + - Sets the the url to use for a PubSub server. +- registerprovider: + - When `registerProvider = false`, then certification app will not register for userInterest provider. ## Supported PubSub Handlers diff --git a/src/App.js b/src/App.js index c0f5ba24..47709083 100644 --- a/src/App.js +++ b/src/App.js @@ -121,6 +121,11 @@ export default class App extends Base { // Set the pubSub URL if present process.env.PUB_SUB_URL = new URLSearchParams(window.location.search).get('pubSubUrl'); + process.env.MACADDRESS = new URLSearchParams(appUrl.search).get('macaddress'); + process.env.CURRENT_APPID = new URLSearchParams(appUrl.search).get('appId'); + process.env.APP_TYPE = new URLSearchParams(appUrl.search).get('appType'); + process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = new URLSearchParams(appUrl.search).get('pubSubSubscribeSuffix'); + process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX = new URLSearchParams(appUrl.search).get('pubSubPublishSuffix'); if (platform) { process.env.PLATFORM = platform; @@ -159,7 +164,6 @@ export default class App extends Base { this.pubSubListener(); } getCurrentAppID().then((res) => { - process.env.APPID = res; this._setState('LoadingState'); }); } @@ -391,7 +395,13 @@ export default class App extends Base { if (lifecycle_validationString == true) { process.env.LIFECYCLE_VALIDATION = 'true'; } + if (query.params.pubSubPublishSuffix) { + process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX = query.params.pubSubPublishSuffix; + } + if (query.params.pubSubSubscribeSuffix) { + process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = query.params.pubSubSubscribeSuffix; + } process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST; try { diff --git a/src/constant.js b/src/constant.js index dbc62c97..61c32889 100644 --- a/src/constant.js +++ b/src/constant.js @@ -174,4 +174,6 @@ export const CONSTANTS = { VERSIONS: 'Versions', NO_RESULT_OR_ERROR_MESSAGE: 'No result or error in response. eg: {jsonrpc: "2.0", id: x }', SCHEMA_VALIDATION: 'Schema Validation', + DEFAULT_APP_ID: 'DEFAULT_APP_ID', + DEFAULT_MAC: 'DEFAULT_MAC', }; diff --git a/src/pubSubClient.js b/src/pubSubClient.js index 1a65c668..c5dd2469 100644 --- a/src/pubSubClient.js +++ b/src/pubSubClient.js @@ -22,8 +22,8 @@ class PubSubClient { constructor() { this.ws = null; this.url = process.env.PUB_SUB_URL ? process.env.PUB_SUB_URL : 'ws://localhost:8080'; - this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = '_FCS'; - this.PUBSUB_PUBLISH_TOPIC_SUFFIX = '_FCA'; + this.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX ? process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX : '_FCS'; + this.PUBSUB_PUBLISH_TOPIC_SUFFIX = process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX ? process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX : '_FCA'; } // Initializes a WS connection diff --git a/src/utils/Utils.js b/src/utils/Utils.js index 4ac82dca..950b5c2d 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -173,6 +173,9 @@ function pushReportToS3(report) { } }); }); + } else { + process.env.MACADDRESS = CONSTANTS.DEFAULT_MAC; + macAddress = process.env.MACADDRESS; } } else { macAddress = process.env.MACADDRESS; @@ -327,7 +330,7 @@ function removeSetInMethodName(apiName) { * @description get the current appid with Advertising.appBundleId */ async function getCurrentAppID() { - if (!process.env.CURRENT_APPID || !process.env.APPID) { + if (!process.env.CURRENT_APPID) { try { let res = await FireboltExampleInvoker.get().invoke(CONSTANTS.CORE.toLowerCase(), 'Advertising.appBundleId', []); const lastIndex = res.lastIndexOf('.'); @@ -336,7 +339,8 @@ async function getCurrentAppID() { return res; } catch (error) { logger.error('Error while calling Advertising.appBundleId : ' + error, 'App getAppId'); - return error; + process.env.CURRENT_APPID = CONSTANTS.DEFAULT_APP_ID; + return process.env.CURRENT_APPID; } } } @@ -396,7 +400,7 @@ async function overrideParamsFromTestData(methodObj) { try { const paramsJson = testDataHandler('overrideParams'); if (paramsJson && typeof paramsJson == 'object' && Object.keys(paramsJson).length) { - const appID = process.env.APPID; + const appID = process.env.CURRENT_APPID; // Checking if any data present for the passed appId const parsedMethod = paramsJson[appID]; // Fetching the examples from the parsedMethod From 3d7c6802b6a0243867d667b8f0d74b6b6691d219 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J <43801187+Abhishk123@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:12:35 +0530 Subject: [PATCH 07/20] Update clearEventHandler.js --- src/pubsub/handlers/clearEventHandler.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pubsub/handlers/clearEventHandler.js b/src/pubsub/handlers/clearEventHandler.js index 5788890f..a929d86e 100644 --- a/src/pubsub/handlers/clearEventHandler.js +++ b/src/pubsub/handlers/clearEventHandler.js @@ -29,6 +29,16 @@ export default class clearEventHandler extends BaseHandler { async handle(message) { const eventInvokerInfo = new EventInvocation(); + let sdkType; + if (!message.params.event.includes('_')) { + sdkType = CONSTANTS.CORE.toLowerCase(); + } else { + sdkType = message.params.event.split('_')[0].toLowerCase(); + } + if (message.action != null && message.action != 'NA') { + sdkType = message.action; + process.env.SDK_TYPE = sdkType; + } try { const validationReport = eventInvokerInfo.clearEventListeners(message.params.event); return JSON.stringify({ report: validationReport }); From c9c5692aa54aa9226372fa8b675a3a559aef7282 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J <43801187+Abhishk123@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:57:18 +0530 Subject: [PATCH 08/20] Update clearEventHandler.js --- src/pubsub/handlers/clearEventHandler.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pubsub/handlers/clearEventHandler.js b/src/pubsub/handlers/clearEventHandler.js index a929d86e..94082477 100644 --- a/src/pubsub/handlers/clearEventHandler.js +++ b/src/pubsub/handlers/clearEventHandler.js @@ -30,9 +30,7 @@ export default class clearEventHandler extends BaseHandler { async handle(message) { const eventInvokerInfo = new EventInvocation(); let sdkType; - if (!message.params.event.includes('_')) { - sdkType = CONSTANTS.CORE.toLowerCase(); - } else { + if (message.params && message.params.event && message.params.event.includes('_')) { sdkType = message.params.event.split('_')[0].toLowerCase(); } if (message.action != null && message.action != 'NA') { From 5f7d391095c06e92906ca5aab14fb0e39061a8e5 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 29 Oct 2024 16:26:40 +0530 Subject: [PATCH 09/20] comment out testtoken --- src/App.js | 14 +++++++------- src/LifeCycleHistory.js | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/App.js b/src/App.js index e50532a7..b63b6cfe 100644 --- a/src/App.js +++ b/src/App.js @@ -103,7 +103,7 @@ export default class App extends Base { const standalone = new URLSearchParams(appUrl.search).get('standalone'); const standalonePrefix = new URLSearchParams(appUrl.search).get('standalonePrefix'); this.systemui = new URLSearchParams(window.location.search).get('systemui'); - this.testToken = new URLSearchParams(window.location.search).get('testtoken'); + // this.testToken = new URLSearchParams(window.location.search).get('testtoken'); this.pubSubUuidPresent = false; this.appContinue = false; process.env.LIFECYCLE_VALIDATION = lifecycle; @@ -111,7 +111,7 @@ export default class App extends Base { process.env.MF_VALUE = false; testContext ? (process.env.TESTCONTEXT = JSON.parse(testContext)) : (process.env.TESTCONTEXT = false); process.env.TESTCONTEXT = true; // Making TESTCONTEXT = true by default. This line will be removed in later stages when required - process.env.TEST_TOKEN = this.testToken; + // process.env.TEST_TOKEN = this.testToken; process.env.REPORTINGID = reportingId; process.env.STANDALONE = standalone; process.env.STANDALONE_PREFIX = standalonePrefix; @@ -417,11 +417,11 @@ export default class App extends Base { console.log('Error getting App Id :: ', err); } - if (query.params.testtoken) { - process.env.TEST_TOKEN = query.params.testtoken; - } else { - logger.error('No Test Token Found in Parameter Initialization response...', 'getParameterInitializationValues'); - } + // if (query.params.testtoken) { + // process.env.TEST_TOKEN = query.params.testtoken; + // } else { + // logger.error('No Test Token Found in Parameter Initialization response...', 'getParameterInitializationValues'); + // } if (query.params.macaddress) { process.env.MACADDRESS = query.params.macaddress; diff --git a/src/LifeCycleHistory.js b/src/LifeCycleHistory.js index 2da8132d..4b1eb447 100644 --- a/src/LifeCycleHistory.js +++ b/src/LifeCycleHistory.js @@ -108,13 +108,13 @@ export default class LifecycleHistory { const query = JSON.parse(event.data.query); // Establishing a pubSub connection if FCA receives an intent in the navigateTo event with the following parameters. - if (query.params && query.params.appId && query.params.testtoken && query.params.macaddress) { + if (query.params && query.params.appId && query.params.macaddress) { // PUBSUB_CONNECTION environment variable has a pubsub client instance and calls the isConnected function to check the Websocket status. if (!process.env.PUBSUB_CONNECTION || (process.env.PUBSUB_CONNECTION && !process.env.PUBSUB_CONNECTION.isConnected())) { process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST; process.env.CURRENT_APPID = query.params.appId; process.env.MACADDRESS = query.params.macaddress; - process.env.TEST_TOKEN = query.params.testtoken; + // process.env.TEST_TOKEN = query.params.testtoken; console.log('2507 test log - query param pubsubtoken discovery navigate', query.params.pubSubToken); process.env.PUB_SUB_TOKEN = query.params.pubSubToken; console.log('2507 test log - process env pubsubtoken discovery navigate', process.env.PUB_SUB_TOKEN); From ce5c2363243e3619a37a184a190bce9066319f45 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 29 Oct 2024 19:19:45 +0530 Subject: [PATCH 10/20] addressed comment --- src/App.js | 8 -------- src/LifeCycleHistory.js | 1 - 2 files changed, 9 deletions(-) diff --git a/src/App.js b/src/App.js index b63b6cfe..e45db91d 100644 --- a/src/App.js +++ b/src/App.js @@ -103,7 +103,6 @@ export default class App extends Base { const standalone = new URLSearchParams(appUrl.search).get('standalone'); const standalonePrefix = new URLSearchParams(appUrl.search).get('standalonePrefix'); this.systemui = new URLSearchParams(window.location.search).get('systemui'); - // this.testToken = new URLSearchParams(window.location.search).get('testtoken'); this.pubSubUuidPresent = false; this.appContinue = false; process.env.LIFECYCLE_VALIDATION = lifecycle; @@ -111,7 +110,6 @@ export default class App extends Base { process.env.MF_VALUE = false; testContext ? (process.env.TESTCONTEXT = JSON.parse(testContext)) : (process.env.TESTCONTEXT = false); process.env.TESTCONTEXT = true; // Making TESTCONTEXT = true by default. This line will be removed in later stages when required - // process.env.TEST_TOKEN = this.testToken; process.env.REPORTINGID = reportingId; process.env.STANDALONE = standalone; process.env.STANDALONE_PREFIX = standalonePrefix; @@ -417,12 +415,6 @@ export default class App extends Base { console.log('Error getting App Id :: ', err); } - // if (query.params.testtoken) { - // process.env.TEST_TOKEN = query.params.testtoken; - // } else { - // logger.error('No Test Token Found in Parameter Initialization response...', 'getParameterInitializationValues'); - // } - if (query.params.macaddress) { process.env.MACADDRESS = query.params.macaddress; } else { diff --git a/src/LifeCycleHistory.js b/src/LifeCycleHistory.js index 4b1eb447..13811947 100644 --- a/src/LifeCycleHistory.js +++ b/src/LifeCycleHistory.js @@ -114,7 +114,6 @@ export default class LifecycleHistory { process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST; process.env.CURRENT_APPID = query.params.appId; process.env.MACADDRESS = query.params.macaddress; - // process.env.TEST_TOKEN = query.params.testtoken; console.log('2507 test log - query param pubsubtoken discovery navigate', query.params.pubSubToken); process.env.PUB_SUB_TOKEN = query.params.pubSubToken; console.log('2507 test log - process env pubsubtoken discovery navigate', process.env.PUB_SUB_TOKEN); From 9e0af70b2ccfd7bbcf1f7391794b987966e5b13c Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 29 Oct 2024 19:27:38 +0530 Subject: [PATCH 11/20] update logs --- src/App.js | 8 +++----- src/LifeCycleHistory.js | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/App.js b/src/App.js index e45db91d..6adfbafa 100644 --- a/src/App.js +++ b/src/App.js @@ -426,17 +426,15 @@ export default class App extends Base { } // Set the pubSub URL if present - console.log('2507 test log - query param', query.params); - console.log('2507 test log - query param pubsuburl', query.params.pubSubUrl); + console.log('2507 test log - query params', query.params); if (query.params.pubSubUrl) { process.env.PUB_SUB_URL = query.params.pubSubUrl; - console.log('2507 test log - process env pubsuburl', process.env.PUB_SUB_URL); + console.log('2507 test log - query params pubsuburl', process.env.PUB_SUB_URL); } // Set the pubSub token if present - console.log('2507 test log - query param pubsubtoken', query.params.pubSubToken); if (query.params.pubSubToken) { process.env.PUB_SUB_TOKEN = query.params.pubSubToken; - console.log('2507 test log - process env pubsubtoken', process.env.PUB_SUB_TOKEN); + console.log('2507 test log - query params pubsubtoken', process.env.PUB_SUB_TOKEN); } if (query.task) { setTimeout(() => { diff --git a/src/LifeCycleHistory.js b/src/LifeCycleHistory.js index 13811947..85701bf9 100644 --- a/src/LifeCycleHistory.js +++ b/src/LifeCycleHistory.js @@ -114,9 +114,8 @@ export default class LifecycleHistory { process.env.APP_TYPE = query.params.appType ? query.params.appType.toLowerCase() : CONSTANTS.FIREBOLT_CONST; process.env.CURRENT_APPID = query.params.appId; process.env.MACADDRESS = query.params.macaddress; - console.log('2507 test log - query param pubsubtoken discovery navigate', query.params.pubSubToken); process.env.PUB_SUB_TOKEN = query.params.pubSubToken; - console.log('2507 test log - process env pubsubtoken discovery navigate', process.env.PUB_SUB_TOKEN); + console.log('2507 test log - query params pubsubtoken discovery navigateTo', process.env.PUB_SUB_TOKEN); const pubSubListenerCreation = new PubSubCommunication(); const webSocketConnection = await pubSubListenerCreation.startWebSocket(); } From a9356803db6711c69697fbf1d78b0525b53a4edc Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 30 Oct 2024 12:05:09 +0530 Subject: [PATCH 12/20] addressed comment --- src/App.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 6adfbafa..b9c2937a 100644 --- a/src/App.js +++ b/src/App.js @@ -118,7 +118,8 @@ export default class App extends Base { process.env.SDKS_AVAILABLE = [...CONSTANTS.defaultSDKs, ...CONSTANTS.additionalSDKs]; // Set the pubSub URL if present - process.env.PUB_SUB_URL = new URLSearchParams(window.location.search).get('pubSubUrl'); + process.env.PUB_SUB_URL = new URLSearchParams(appUrl.search).get('pubSubUrl'); + process.env.PUB_SUB_TOKEN = new URLSearchParams(appUrl.search).get('pubSubToken'); process.env.MACADDRESS = new URLSearchParams(appUrl.search).get('macaddress'); process.env.CURRENT_APPID = new URLSearchParams(appUrl.search).get('appId'); process.env.APP_TYPE = new URLSearchParams(appUrl.search).get('appType'); From 30bc15e6383c601646eb24f709c2caa3ae3f48f3 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 30 Oct 2024 12:21:13 +0530 Subject: [PATCH 13/20] dummy commit --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index b9c2937a..73b3cd96 100644 --- a/src/App.js +++ b/src/App.js @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License. + * limitations under the License * * SPDX-License-Identifier: Apache-2.0 */ From 7c8cab54919828f565b88e470c6671391073bff4 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 30 Oct 2024 15:45:43 +0530 Subject: [PATCH 14/20] merge dev --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 35e7c28e..a48e9384 100644 --- a/README.md +++ b/README.md @@ -180,4 +180,4 @@ To activate Mock Firebolt, there are specific start-up scripts that exist inside For pinChallenge and acknowledgeChallenge UI prompts , a timeout of 15s is added so that, if no action is taken when the prompts displays on the screen (i.e; neither yes/no/back button ), the prompts will be automatically dismissed with "null" value as the response. The prompt is displayed when the user needs to grant/deny a particular api, or the user has to enter a pin in-case of pinChallenge. -If user wants to grant an api, yes button is pressed, for deniel - no button, and incase if the user wants to dismiss the prompt without any action, back button is pressed. \ No newline at end of file +If user wants to grant an api, yes button is pressed, for deniel - no button, and incase if the user wants to dismiss the prompt without any action, back button is pressed. From f0dc327ffb52d65f96b013a54687b7a7d6da1276 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Tue, 12 Nov 2024 12:54:25 +0530 Subject: [PATCH 15/20] Catch region from intent --- src/App.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/App.js b/src/App.js index 73b3cd96..9edea1bb 100644 --- a/src/App.js +++ b/src/App.js @@ -437,6 +437,11 @@ export default class App extends Base { process.env.PUB_SUB_TOKEN = query.params.pubSubToken; console.log('2507 test log - query params pubsubtoken', process.env.PUB_SUB_TOKEN); } + // Set the region if present + if (query.params.region) { + process.env.REGION = query.params.region; + console.log('2507 test log - query params region', process.env.REGION); + } if (query.task) { setTimeout(() => { const intentReader = new IntentReader(); From 4dd7c534de60de1abca304e82070167bd43c691c Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 15 Nov 2024 10:35:00 +0530 Subject: [PATCH 16/20] reverted default_mac logic --- src/constant.js | 1 - src/utils/Utils.js | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/constant.js b/src/constant.js index 61c32889..8452f458 100644 --- a/src/constant.js +++ b/src/constant.js @@ -175,5 +175,4 @@ export const CONSTANTS = { NO_RESULT_OR_ERROR_MESSAGE: 'No result or error in response. eg: {jsonrpc: "2.0", id: x }', SCHEMA_VALIDATION: 'Schema Validation', DEFAULT_APP_ID: 'DEFAULT_APP_ID', - DEFAULT_MAC: 'DEFAULT_MAC', }; diff --git a/src/utils/Utils.js b/src/utils/Utils.js index 950b5c2d..000067e5 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -173,9 +173,6 @@ function pushReportToS3(report) { } }); }); - } else { - process.env.MACADDRESS = CONSTANTS.DEFAULT_MAC; - macAddress = process.env.MACADDRESS; } } else { macAddress = process.env.MACADDRESS; From a883fe2e7322416abcc41d8059d62ddb5d10b6cb Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 15 Nov 2024 19:09:39 +0530 Subject: [PATCH 17/20] removed default_appId logic --- src/constant.js | 1 - src/utils/Utils.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/constant.js b/src/constant.js index 8452f458..dbc62c97 100644 --- a/src/constant.js +++ b/src/constant.js @@ -174,5 +174,4 @@ export const CONSTANTS = { VERSIONS: 'Versions', NO_RESULT_OR_ERROR_MESSAGE: 'No result or error in response. eg: {jsonrpc: "2.0", id: x }', SCHEMA_VALIDATION: 'Schema Validation', - DEFAULT_APP_ID: 'DEFAULT_APP_ID', }; diff --git a/src/utils/Utils.js b/src/utils/Utils.js index 000067e5..055f5ebe 100644 --- a/src/utils/Utils.js +++ b/src/utils/Utils.js @@ -336,8 +336,7 @@ async function getCurrentAppID() { return res; } catch (error) { logger.error('Error while calling Advertising.appBundleId : ' + error, 'App getAppId'); - process.env.CURRENT_APPID = CONSTANTS.DEFAULT_APP_ID; - return process.env.CURRENT_APPID; + return error; } } } From e6647551dfbb17c92ad86238c5647f5e915c79bc Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Tue, 19 Nov 2024 21:45:07 +0530 Subject: [PATCH 18/20] Removed console logs --- src/App.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/App.js b/src/App.js index 9edea1bb..9f968e29 100644 --- a/src/App.js +++ b/src/App.js @@ -11,7 +11,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License + * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 */ @@ -427,20 +427,16 @@ export default class App extends Base { } // Set the pubSub URL if present - console.log('2507 test log - query params', query.params); if (query.params.pubSubUrl) { process.env.PUB_SUB_URL = query.params.pubSubUrl; - console.log('2507 test log - query params pubsuburl', process.env.PUB_SUB_URL); } // Set the pubSub token if present if (query.params.pubSubToken) { process.env.PUB_SUB_TOKEN = query.params.pubSubToken; - console.log('2507 test log - query params pubsubtoken', process.env.PUB_SUB_TOKEN); } // Set the region if present if (query.params.region) { process.env.REGION = query.params.region; - console.log('2507 test log - query params region', process.env.REGION); } if (query.task) { setTimeout(() => { From 9f5339553337a5a379edb311ab2e42f76adb3dee Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Wed, 20 Nov 2024 09:26:33 +0530 Subject: [PATCH 19/20] Removed console logs --- src/LifeCycleHistory.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/LifeCycleHistory.js b/src/LifeCycleHistory.js index 85701bf9..dfc4ae85 100644 --- a/src/LifeCycleHistory.js +++ b/src/LifeCycleHistory.js @@ -115,7 +115,6 @@ export default class LifecycleHistory { process.env.CURRENT_APPID = query.params.appId; process.env.MACADDRESS = query.params.macaddress; process.env.PUB_SUB_TOKEN = query.params.pubSubToken; - console.log('2507 test log - query params pubsubtoken discovery navigateTo', process.env.PUB_SUB_TOKEN); const pubSubListenerCreation = new PubSubCommunication(); const webSocketConnection = await pubSubListenerCreation.startWebSocket(); } From 5503ab6e8ab5174606b156612c6f3ddf1399bef9 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Mon, 25 Nov 2024 21:19:47 +0530 Subject: [PATCH 20/20] Catching region from url params --- src/App.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.js b/src/App.js index 9f968e29..22b1ec38 100644 --- a/src/App.js +++ b/src/App.js @@ -125,6 +125,7 @@ export default class App extends Base { process.env.APP_TYPE = new URLSearchParams(appUrl.search).get('appType'); process.env.PUBSUB_SUBSCRIBE_TOPIC_SUFFIX = new URLSearchParams(appUrl.search).get('pubSubSubscribeSuffix'); process.env.PUBSUB_PUBLISH_TOPIC_SUFFIX = new URLSearchParams(appUrl.search).get('pubSubPublishSuffix'); + process.env.REGION = new URLSearchParams(appUrl.search).get('region'); if (platform) { process.env.PLATFORM = platform;