Skip to content

Conversation

gab-arrobo
Copy link
Contributor

No description provided.

@gab-arrobo gab-arrobo requested review from a team and Copilot October 1, 2025 17:29
Copy link

@Copilot 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 replaces the external github.com/tim-ywliu/event dependency with a custom implementation using standard Go libraries. The change implements a custom event dispatcher system to handle SM policy notifications without relying on third-party dependencies.

  • Replaced external event library with custom Go implementation
  • Added event handler interface and dispatcher with thread-safe operations
  • Enhanced error handling and logging for event processing

Reviewed Changes

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

Show a summary per file
File Description
internal/notifyevent/dispatcher.go Implements new custom event dispatcher with handlers and thread-safe operations
internal/notifyevent/listener.go Updates listener to implement new EventHandler interface with improved error handling
internal/notifyevent/send_smpolicy_update.go Removes external dependency, adds HandleEvent method and constructor function
internal/notifyevent/send_smpolicy_termination.go Removes external dependency, adds HandleEvent method and constructor function
go.mod Removes the external event dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +58 to +62
func (e SendSMpolicyUpdateNotifyEvent) HandleEvent(eventName string, data any) error {
// This method is called by the dispatcher
e.Handle()
return nil
}
Copy link
Preview

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The HandleEvent method ignores the eventName and data parameters but receives the event data through the receiver. This creates confusion about which data source should be used. Consider using the data parameter to maintain consistency with the interface design, or document why the receiver data takes precedence.

Copilot uses AI. Check for mistakes.

Comment on lines +58 to +62
func (e SendSMpolicyTerminationNotifyEvent) HandleEvent(eventName string, data any) error {
// This method is called by the dispatcher
e.Handle()
return nil
}
Copy link
Preview

Copilot AI Oct 1, 2025

Choose a reason for hiding this comment

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

The HandleEvent method ignores the eventName and data parameters but receives the event data through the receiver. This creates confusion about which data source should be used. Consider using the data parameter to maintain consistency with the interface design, or document why the receiver data takes precedence.

Copilot uses AI. Check for mistakes.

Signed-off-by: Arrobo, Gabriel <[email protected]>
@gab-arrobo gab-arrobo merged commit 59c7abc into omec-project:main Oct 1, 2025
9 of 10 checks passed
@gab-arrobo gab-arrobo deleted the use-standard-library branch October 1, 2025 18:10
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