refreshing page increases number of duplicate masseges sent

Skip to first unread message

Светозар Волков

May 17, 2017, 3:10:25 AM5/17/17
to Faye users
Hello everyone!
I develop web application using Faye and every time i click button it should send a message to the server, but if i refresh page it sends two messages at once. Every time i refresh page the number of duplicate messages increases by one.
Can anyone explain what can the reason be? Thanks a lot!

James Coglan

Jun 3, 2017, 8:04:52 AM6/3/17
This sounds like there is state hanging around between page views, i.e. you old event handlers for the button are sticking around each time you refresh the page.

Can you explain more what you mean by "refreshing the page"? Is this a single-page web app where a new "page" is loaded with JS, or is it genuinely a new page from the browser's point of view? Are you reusing a Faye client across page views? Is there any way your event handlers for the button could be being added multiple times?
Reply all
Reply to author
0 new messages