Skip to content

Conversation

@Abhishk123
Copy link
Contributor

Description

Enter a detailed description of the PR here, including the nature and purpose of the changes.

JIRA Ticket

Include a link to the JIRA Ticket linked to this PR.
Issue-0000

Additional Info (Test steps / Steps to reproduce etc.)

Details on how to test the feature

@github-actions
Copy link

Issue with linting or unit tests detected.
Unit tests failed.

@github-actions
Copy link

Issue with linting or unit tests detected.
Unit tests failed.

PreethiMaai pushed a commit that referenced this pull request Apr 10, 2025
PreethiMaai pushed a commit that referenced this pull request Apr 10, 2025
# [1.5.0](rdkcentral/firebolt-certification-suite@v1.4.0...v1.5.0) (2024-12-19)

### Bug Fixes

* Added support in FCS for the external events ([#262](rdkcentral/firebolt-certification-suite#262)) ([aab804d](rdkcentral/firebolt-certification-suite@aab804d))
* entos intent support in fcs to get values from cli ([#281](rdkcentral/firebolt-certification-suite#281)) ([834ca87](rdkcentral/firebolt-certification-suite@834ca87))
* Trimming the new line in logs ([#285](rdkcentral/firebolt-certification-suite#285)) ([36f7b2f](rdkcentral/firebolt-certification-suite@36f7b2f))

### Features

* Add validation to ensure that the app launched is in foreground ([#264](rdkcentral/firebolt-certification-suite#264)) ([0132a0f](rdkcentral/firebolt-certification-suite@0132a0f))
* Capabilities Cleanup + SevTags ([#267](rdkcentral/firebolt-certification-suite#267)) ([6f3cc05](rdkcentral/firebolt-certification-suite@6f3cc05))
* Enhancement of dynamic glue codes ([#263](rdkcentral/firebolt-certification-suite#263)) ([59df9da](rdkcentral/firebolt-certification-suite@59df9da))
* LP sat changes ([#295](rdkcentral/firebolt-certification-suite#295)) ([73e5c4b](rdkcentral/firebolt-certification-suite@73e5c4b))
* Performance log enhancement ([#275](rdkcentral/firebolt-certification-suite#275)) ([c806aeb](rdkcentral/firebolt-certification-suite@c806aeb))
* remove obsolete json data ([#277](rdkcentral/firebolt-certification-suite#277)) ([8d7e51d](rdkcentral/firebolt-certification-suite@8d7e51d))
* Update App Exit Handling ([#266](rdkcentral/firebolt-certification-suite#266)) ([d4a96b7](rdkcentral/firebolt-certification-suite@d4a96b7))
* UserGants, LifecycleBackground cleanup + sev tags ([#276](rdkcentral/firebolt-certification-suite#276)) ([7014175](rdkcentral/firebolt-certification-suite@7014175))
* XSB keyboard module cleanup ([#272](rdkcentral/firebolt-certification-suite#272)) ([04fcf22](rdkcentral/firebolt-certification-suite@04fcf22))
* XSB metrics cleanup ([#292](rdkcentral/firebolt-certification-suite#292)) ([194dbf7](rdkcentral/firebolt-certification-suite@194dbf7))
* XSB metrics_rpconly cleanup ([#293](rdkcentral/firebolt-certification-suite#293)) ([7cd21ab](rdkcentral/firebolt-certification-suite@7cd21ab))
* XSB Parameters module update ([#274](rdkcentral/firebolt-certification-suite#274)) ([bc0187b](rdkcentral/firebolt-certification-suite@bc0187b))
* XSB profile module cleanup ([#273](rdkcentral/firebolt-certification-suite#273)) ([6dcabaa](rdkcentral/firebolt-certification-suite@6dcabaa))
* XSB SecondScreen cleanup ([#290](rdkcentral/firebolt-certification-suite#290)) ([eced08d](rdkcentral/firebolt-certification-suite@eced08d))
* XSB SecureSotrage cleanup ([#286](rdkcentral/firebolt-certification-suite#286)) ([c2244df](rdkcentral/firebolt-certification-suite@c2244df))
* XSB UserInterest cleanup ([#291](rdkcentral/firebolt-certification-suite#291)) ([566952c](rdkcentral/firebolt-certification-suite@566952c))
@Eswar2103 Eswar2103 changed the base branch from dev to FIREBOLT-V2 May 20, 2025 15:11
};
});

// jest.mock('../../node_modules/@firebolt-js/sdk/dist/lib/Gateway/index.mjs', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a valid test? Why is it commented?

Copy link
Contributor

Choose a reason for hiding this comment

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

uncommented and corrected it

callId++;
const id = callId; // a mock ID value
eventList.push(eventName + '-' + id);
console.log('eventList----:', eventList);
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a debug log?

Copy link
Contributor

Choose a reason for hiding this comment

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

removed logs


async northBoundEventHandling(message) {
try {
console.log('----------------------');
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a debug log?

Copy link
Contributor

Choose a reason for hiding this comment

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

removed logs

expect(result.id).toBe(expectedResponse.id);
expect(result.result).toStrictEqual(expectedResponse.result);
});
// Check on how to mock the Gateway from firebolt v2 and use it in the test
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor

Choose a reason for hiding this comment

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

uncommented and corrected it

src/App.js Outdated
this.accessibilityCheck(voiceAnnouncement);
});
this.toastStates = [];
// Setting the default execution to the Firebolt v2
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be documented somewhere because the end user will not check the code

Copy link
Contributor

Choose a reason for hiding this comment

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

Added comments

return [err, null];
}

// Construct unique key for event handler. A UUID can be added to the key to make it more unique.
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be more descriptive so we will get know why we are creating this UUID

Copy link
Contributor

Choose a reason for hiding this comment

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

done

});
eventHandlerMap.clear();
logger.info('After clearing listeners' + JSON.stringify(eventHandlerMap), 'clearAllListeners');
return 'Cleared Listeners';
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move all these return statements to constants ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done

@rdkcmf-jenkins
Copy link
Contributor

Coverity detected 1 issue; a quality concern.

return await invokeProvider.send(module, method, jsonParams);
} else if (invoker == CONSTANTS.INVOKEMANAGER) {
return await invokeManager.send(module, method, jsonParams);
} else if (process.env.IS_BIDIRECTIONAL_SDK === true || process.env.IS_BIDIRECTIONAL_SDK === 'true') {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if it comes as "True"?

We can, if we detect a string, run .toLowerCase() and compare that.

if (process.env.IS_BIDIRECTIONAL_SDK === true || (typeof process.env.IS_BIDIRECTIONAL_SDK === 'string' && process.env.IS_BIDIRECTIONAL_SDK.toLowerCase() === 'true')

Copy link
Contributor

@Eswar2103 Eswar2103 Jun 9, 2025

Choose a reason for hiding this comment

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

it wont come as True,
Two cases here, boolean true and string 'true'

  1. Boolean true is assigned in app.js, it will check for sdk version fetching from openrpc and do a regex check of whether it is above 2.x.x and if yes, assign it with true, else false.
  2. String true, the reason string true check is add is because of unit testcases, in jest unit testcases any value that gets assigned to an env will convert to string, whether it is boolean or object or array. So while doing comparision, those unit testcases are failing because of this condition, where true(boolean) is coming as 'true' string.
    Value that I am assigning every where in unit testcases is boolean, but still internally it is converting it as a string.
    That is the reason, added a check on string true

Copy link
Contributor

Choose a reason for hiding this comment

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

it won't come as true

We shouldn't assume that. You're checking a process variable that anyone anywhere in FCA can modify. Just because today no one's setting it to "True" or even "tRuE" doesn't mean it won't happen tomorrow.

Copy link
Contributor

Choose a reason for hiding this comment

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

corrected it

class EventRegistrationInterface {
async clearEventListeners(event) {
try {
const [sdkType, module] = this.getSdkTypeAndModule(event);
Copy link
Contributor

Choose a reason for hiding this comment

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

I see us parsing an event over and over in this code.

Can we build a utility function in this file that takes in an event and gives an object containing:

  • SDK (Core, manage, discovery, etc)
  • Event Module
  • Event Method (Ex: onClosedCaptionChanged)
  • Event Name (Ex: closedCaptionChanged)
  • Anything else we need

That object can be used where we need it to be.

Copy link
Contributor

Choose a reason for hiding this comment

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

corrected

* parseEventNameAndModuleAndSDKType('firebolt_foo.onExampleEvent')
* returns ['firebolt', 'foo', 'onExampleEvent', 'exampleEvent']
*/
parseEventNameAndModuleAndSDKType(moduleWithEventName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is great. Can we use this in the other locations where we're taking a "moduleWithEventName" and parsing it?

Copy link
Contributor

@Eswar2103 Eswar2103 Jun 12, 2025

Choose a reason for hiding this comment

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

corrected it, in most of the places

@Eswar2103 Eswar2103 merged commit 74ef8c6 into FIREBOLT-V2 Jun 23, 2025
@Eswar2103 Eswar2103 deleted the biDirectionalEventHandlin branch June 23, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants