How to close Notifications in Vaadin 8.2 while using @PreserveOnRefresh on

I updated our vaadin application from 8.1.7 to 8.2.0. I noticed a major change in notifications. Reloading page would show all old notifications (closed by user) again and user have to close them manualy. We are using @PreserveOnRefresh annotation in our UI and I noticed that if I am removing @PreserveOnRefresh then reloading page will not cause showing old notifications. We are using @PreserveOnRefresh to maintain selected tab in application tab sheet.
I found a solution to both keep @PreserveOnRefresh and not showing old notifications while reloading page. By adding a closeListener (added in Vaadin 8.2) and removing notification manually as below:

Notification notification = new Notification(“Parsing warning”, message, Notification.Type.TRAY_NOTIFICATION);
notification.addCloseListener((Notification.CloseListener) event → event.getNotification().remove());;

The questions are if Vaadin developers have thought about how to use new changes in notification with
[/code]@PreserveOnRefresh annotation and there is a better way to handle this?

If not then I wonder which solution is better: 1- Removing @PreserveOnRefresh and selecting selected tab after reloading page again (By saving selected tab as a session attribute) or 2- Adding a close listener to every notification and removing them manually inside close method?

This sure is a regression. I see you already filed a ticke about this: . As Artur has already done a fix for it, it will probably be solved in the next bugfix release.