openwisp / openwisp-notifications

Notifications module of OpenWISP
https://openwisp.io/docs/dev/notifications/
GNU General Public License v3.0
40 stars 41 forks source link

[ui:bug] Notification Toast Container Disappears #264

Open Aryamanz29 opened 1 year ago

Aryamanz29 commented 1 year ago

I encountered a bug while implementing background API tasks for the ZeroTier VPN backend in openwisp-controller.

When a background API task encounters an unrecoverable failure or recovers from any API failures, it generates an error or recovery type notification, respectively. However, if this notification is generated right after saving or updating the VPN object, the notification toast gets automatically dismissed due to the already-present Django model object's success message.

api_task_notification_bug

I tried to address this issue by adding some delay to the notification, but this solution may not be optimal. We need to find a better and more reliable solution to prevent the notification toast from disappearing prematurely.

pandafy commented 1 year ago

@Aryamanz29 you misinterpreted the bug here.

When the user clicks on the "Save and Continue" or "Save" button, the webpage reloads. This closes the websocket connection. The websocket connection is established again after the page loads.

The notification toast is only shown when a notification is received through the websocket connection.