Skip to content

Commit

Permalink
refactor: minor changes
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Yuichi Okimoto <[email protected]>
  • Loading branch information
cre8ivejp committed Jan 28, 2025
1 parent 126058a commit b243d57
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pkg/notification/sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ func (s *sender) checkForFeatureDomainEvent(
entityData string,
) (bool, error) {
// Different domain event
if sourceType != notificationproto.Subscription_DOMAIN_EVENT_FEATURE {
if sourceType != notificationproto.Subscription_DOMAIN_EVENT_FEATURE ||
len(sub.FeatureFlagTags) == 0 {
s.logger.Debug(
"Skipping notification. Different domain event",
zap.String("environmentId", sub.EnvironmentId),
Expand All @@ -240,18 +241,6 @@ func (s *sender) checkForFeatureDomainEvent(
)
return true, nil
}
// No tags configured
if len(sub.FeatureFlagTags) == 0 {
s.logger.Debug(
"Skipping notification. No feature flag tags configured.",
zap.String("environmentId", sub.EnvironmentId),
zap.String("subscriptionId", sub.Id),
zap.String("subscriptionName", sub.Name),
zap.Strings("subscriptionTags", sub.FeatureFlagTags),
zap.String("entityData", entityData),
)
return true, nil
}
// Unmarshal the JSON string into the Feature message
var feature ftproto.Feature
if err := protojson.Unmarshal([]byte(entityData), &feature); err != nil {
Expand Down

0 comments on commit b243d57

Please sign in to comment.