Skip to content

Conversation

marcelklehr
Copy link
Member

To avoid unnecessary work and logs

To avoid unnecessary work and logs

Signed-off-by: Marcel Klehr <[email protected]>
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 adds an early guard clause in the prepare method to avoid unnecessary work and logs when no external apps are enabled.

  • Introduces a check for an empty ExApps list and throws UnknownNotificationException if none are configured.
  • Retains existing behavior of throwing the same exception when a specific app is unknown.
Comments suppressed due to low confidence (1)

lib/Notifications/ExAppNotifier.php:39

  • New behavior for an empty ExApps list should be covered by a unit test to ensure the exception is thrown as expected.
		if (count($this->service->getExAppsList()) === 0) {

more performant

Signed-off-by: Marcel Klehr <[email protected]>
@oleksandr-nc
Copy link
Contributor

Is it just to hide the debug log line?

Because getExAppsList and getExApp use the same code.

@marcelklehr
Copy link
Member Author

Yes

@oleksandr-nc
Copy link
Contributor

another option - maybe we just remove that debug line?

@marcelklehr
Copy link
Member Author

As you wish. I was trying to keep the behavioural change minimal :)

@oleksandr-nc
Copy link
Contributor

Of course, I prefer to remove this debug line (it's a less significant change), but I am happy with the current approach.

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.

3 participants