Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow retrigger_time of 0 for notifications #1453

Open
FlorentP42 opened this issue Aug 27, 2024 · 3 comments
Open

Allow retrigger_time of 0 for notifications #1453

FlorentP42 opened this issue Aug 27, 2024 · 3 comments
Assignees

Comments

@FlorentP42
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When creating a notification instance of type retriggered, you can define the retrigger_time which is the interval the notification instance must wait before sending two consecutive notifications.

One of the use cases we use notifications for in the context of systemsp requires this time to be zero.

However both the Fledge backend and the Fledge GUI does not allow a value of zero for the retrigger_time parameter.

Describe the solution you'd like
Allow a value of 0 for retrigger_time when defining or editing a notification instance.

Describe alternatives you've considered
Currently we are using the following workaround which initializes the notification service with retrigger_time=1 and then edit that configuration with retrigger_time=-1:

# Create Notification plugins
curl -sX POST http://localhost:8081/fledge/notification -d '{"name":"'$notif_name_1'","description":"'$notif_name_1' notification instance","rule":"'$notif_plugin_1'","channel":"'$notif_plugin_2'","notification_type":"retriggered","enabled":true,"retrigger_time":"1","rule_config":{},"delivery_config":{}}'
# Workaround for delay between notifications (we want 0 but Fledge does not allow it, and -1 is rejected at notification instance creation)
curl -X PUT --data '{"retrigger_time":"-1"}' http://localhost:8081/fledge/category/$notif_name_1

This is a pretty ugly solution which is subject to break if the Fledge API gets updated and also starts to refuse negative values.

Additional context
Existing repositories that would benefit from this features:

@mshariq-nerd
Copy link
Member

mshariq-nerd commented Sep 4, 2024

@FlorentP42 This issue has been fixed. You can verify the available fix in current develop & nightly packages.
API : #1457
GUI: fledge-iot/fledge-gui#455

@FlorentP42
Copy link
Contributor Author

Great news :) Is it all right to leave this issue open until an official release containing the fix is produced?

@mshariq-nerd
Copy link
Member

Yeah sure, we can close this once fix is available in next official release.

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

No branches or pull requests

3 participants
@mshariq-nerd @FlorentP42 and others