[SSE Traditional Client] Preventing duplicated events after refresh
Web icon
Forge component by Nuno Damaso
Application Type
Traditional Web
Service Studio Version
11.54.27 (Build 62849)


I've been looking into this component and it makes it easy to setup a working solution.
I did encounter an issue related to refreshing of the component. I have a situation where the component lives on a webblock that processes and shows the incoming messages. When this webblock is refreshed by the parent screen, a second listener is created and all messages are received twice.

Is there a way to prevent the EventSource webblock from creating a new connection upon Ajax refresh?


For now I've solved this using a copy of the EventSource webblock with an extra parameter, IsLoadingScreen (set by IsLoadingScneen()) and wrapping the last Container on the screen, that initializes the SSE Connection, in an IF.  When the webblock is being refreshed, IsLoadingScreen is false and no new, extra connection will be initialized.

Hi Lennart!

I tried to replicate your scenario but I may be missing something - I expanded the Demo App - Traditional_Chat_Web with another screen that has a WebBlock with the SSE. There's a button that triggers an ajax refresh and then I'm using the chat app screen to send messages.

With this setup I am unable to get the duplicate you mention:

Are you able to replicate on this setup on this app? Follows the .oap attached.

SSE Traditional Client -Demo.oap

Hi Nuno,

Thanks for your response.
I noticed that you had set the On Click method of the Ajax Refresh button to 'Submit' instead of 'Ajax Submit'
After I had changed this, I could reproduce the issue. At first there's one eventsource listener for 'chat':

After refreshing there are 2, which also results in duplicated messages on the screen:

With 2 results. I have added an expression to WebScreen1 to show the incoming messages:

As I said, for now I'm using a copy of the EventSource webblock, but it would be nice to be able to use the forge component.


My bad, I am now able to reproduce it. 

I will look into this and keep you posted.

Thanks for pointing it out!

Hi Lennart, 

Sorry this took me awhile, there's a new release of the traditional client up that should have this issue fixed. 

Let me know if this is working properly when you can find some time.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.