Skip to content

Conversation

@adrianM27
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 31, 2025 10:31
@adrianM27 adrianM27 requested a review from a team as a code owner October 31, 2025 10:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the event emission mechanism in the AppNotifications API by extracting the Emit method into a separate callback interface. The changes enable a callback-based approach where event emitters are passed to handlers rather than being directly invoked on the main interface.

Key changes:

  • Extracted Emit method into a new nested IEmiter callback interface
  • Modified HandleAppEventNotifier to accept an emitter callback parameter
  • Changed Emit return type from Core::hresult to void

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
apis/Ids.h Added new ID constant for the emitter callback interface
apis/AppNotifications/IAppNotifications.h Refactored event emission into a callback interface and updated handler signature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

apis/Ids.h Outdated
ID_APP_NOTIFICATIONS = ID_ENTOS_OFFSET + 0x450,
ID_APP_NOTIFICATIONS_HANDLER_INTERNAL = ID_APP_NOTIFICATIONS + 1
ID_APP_NOTIFICATIONS_HANDLER_INTERNAL = ID_APP_NOTIFICATIONS + 1,
ID_APP_NOTIFICATIONS_HANDLER_INTERNAL_EMITER = ID_APP_NOTIFICATIONS + 2
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'EMITER' to 'EMITTER'.

Suggested change
ID_APP_NOTIFICATIONS_HANDLER_INTERNAL_EMITER = ID_APP_NOTIFICATIONS + 2
ID_APP_NOTIFICATIONS_HANDLER_INTERNAL_EMITTER = ID_APP_NOTIFICATIONS + 2

Copilot uses AI. Check for mistakes.
};


struct EXTERNAL IEmiter : virtual public Core::IUnknown
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'IEmiter' to 'IEmitter'.

Copilot uses AI. Check for mistakes.

struct EXTERNAL IEmiter : virtual public Core::IUnknown
{
enum { ID = ID_APP_NOTIFICATIONS_HANDLER_INTERNAL_EMITER };
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'EMITER' to 'EMITTER' to match the corrected constant name.

Copilot uses AI. Check for mistakes.

// @json:omit
// @text handleAppEventNotifier
// @brief Handle AppEvent Notfier expectations for a given event
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'Notfier' to 'Notifier'.

Suggested change
// @brief Handle AppEvent Notfier expectations for a given event
// @brief Handle AppEvent Notifier expectations for a given event

Copilot uses AI. Check for mistakes.
// @param status: status to be filled in
// @returns Core::hresult
virtual Core::hresult HandleAppEventNotifier(const string& event /* @in */, const bool& listen /* @in */, bool& status /* @out */) = 0;
virtual Core::hresult HandleAppEventNotifier(IEmiter *emitCb, const string& event /* @in */, const bool& listen /* @in */, bool& status /* @out */) = 0;
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'IEmiter' to 'IEmitter' to match the corrected interface name.

Copilot uses AI. Check for mistakes.
@adrianM27 adrianM27 force-pushed the feature/RDKEMW-9458_Fb_claud_plugis_fixes branch from 6aa91d5 to 7517319 Compare October 31, 2025 10:51
@adrianM27 adrianM27 requested a review from Copilot October 31, 2025 10:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// @param event: the event to emit
// @param payload: the payload to emit
// @param appId (optional): the appId to emit the event for, if empty the event is emitted for all Apps
virtual void Emit(const string &event /* @in */,
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The return type changed from Core::hresult to void, removing the ability to report errors during emission. Consider keeping Core::hresult as the return type to allow error handling and propagation when emission fails.

Suggested change
virtual void Emit(const string &event /* @in */,
virtual Core::hresult Emit(const string &event /* @in */,

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For notification we do not return a value

// @param status: status to be filled in
// @returns Core::hresult
virtual Core::hresult HandleAppEventNotifier(const string& event /* @in */, const bool& listen /* @in */, bool& status /* @out */) = 0;
virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0;
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The emitCb parameter should be a reference (IEmitter&) or a smart pointer rather than a raw pointer to clarify ownership semantics and prevent null pointer issues. If null is a valid value, this should be documented in the @param comment.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats a THunder way of passing pointers

@adrianM27 adrianM27 force-pushed the feature/RDKEMW-9458_Fb_claud_plugis_fixes branch from 7517319 to 686890c Compare November 3, 2025 08:51
@adrianM27 adrianM27 requested a review from Copilot November 3, 2025 14:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// @param status: status to be filled in
// @returns Core::hresult
virtual Core::hresult HandleAppEventNotifier(const string& event , const bool& listen , bool& status /* @out */) = 0;
virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0;
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The emitCb parameter should be marked with /* @in */ to be consistent with other parameters and clarify it's an input parameter. Additionally, consider whether this should be a non-nullable pointer or if it should use a reference instead.

Suggested change
virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0;
virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb /* @in */, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0;

Copilot uses AI. Check for mistakes.
// @param status: status to be filled in
// @returns Core::hresult
virtual Core::hresult HandleAppEventNotifier(const string& event , const bool& listen , bool& status /* @out */) = 0;
virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0;
Copy link

Copilot AI Nov 3, 2025

Choose a reason for hiding this comment

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

The parameter listen is changed from const bool& to bool. For consistency with the existing codebase style where the original signature used const bool&, consider whether this change in parameter passing style is intentional. If this is a breaking API change, ensure it's documented.

Suggested change
virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, bool listen /* @in */, bool& status /* @out */) = 0;
virtual Core::hresult HandleAppEventNotifier(IEmitter *emitCb, const string& event /* @in */, const bool& listen /* @in */, bool& status /* @out */) = 0;

Copilot uses AI. Check for mistakes.
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.

2 participants