Premium Notifications add-on, a few questions

Many of the APIs in the premium Notifications add-on are marked “experimental” and “subject to change or removal.” How accurate is this? It’s a premium add-on…

How often does the icon that gets added via the recommended

<window xmlns=""
        <cssLayout id="horizontalWrap"
            <drawer id="drawer" expandOnHover="true">
                <!-- ... -->
                <ntf:notificationsIndicator id="ntfIndicator"/> 

… get updated? I’m testing it, and it doesn’t seem to update at all. Is there a way to change or extend this?

Looking at the problem further, I see in there is a reloadCounter() method that gets called by an event listener…

    public void handlePushEvent(VaadinSessionNotificationEvent event) {
        if (event.isBroadcast()) {
        } else {
            if (currentAuthentication.isSet()) {
                UserDetails user = currentAuthentication.getUser();
                String username = user.getUsername();
                if (username.equals(event.getUsername())) {

VaadinSessionNotificationEvent is the event published by the in-app notification classes, but this reloadCounter() doesn’t seem to ever happen, or happens on such a delay that I never see it happen in testing.

I have 2 browsers open, one logged in as admin creating notifications for the user logged in on the other browser. The other user’s indicator never updates.

Is there a way to fix this, or can I extend this in some way to make that happen? Or am I missing a configuration parameter somewhere? (Doesn’t seem so though.)

Seems one can “force” an update on an interval by adding a timer into the MainScreen, and doing like this:

    public void onUpdateNotiCounterTimerTimerAction(Timer.TimerActionEvent event) {
        NotificationsIndicator n = (NotificationsIndicator) getWindow().getComponent("ntfIndicator");
        if (n != null) n.reloadCounter();

But I definitely wonder why it is not updating “as needed” when the Vaadin event is published, like the source code would suggest. Bug, or…?

1 Like

Ideas here? :slight_smile:

It’s seems to be a bug. I’ve created an issue. We’ll try to fix it in the upcoming 1.3.3 release. Your solution with a timer is good and you may use it for now as a workaround.

1 Like

Excellent, thank you. :slight_smile: