Hi,
This is a complicated question and quite random problem. But think have simulated the situation.
Hopefully someone else has experienced it.
I have a button that sends an email with a code. then the person submits the code on the webpage.
The code is stored using wf:state/2 (I release the state is stored on the page).
So click button send code then enter code and press another button.
The code always looks ok to the person using it i.e. buttons are disabled and enabled as per javascript of the module.
The problem is that wf:state/1 returns undefined some of the times.
I am don't see any javascript errors. As I mentioned it is very difficult to simulate but it seems that before the websockets upgrades the button on the page is pressed and an email is sent, then when code is entered the wf:state returns undefined.
While if you wait for the page to load and the javascript console says Websockets Enabled then pressing the button to send email correctly stores the state correctly.
For additional information I have added the following to yaws_simple_bridge_anchor line 17 " error_logger:info_msg("~pUpgrade:~p", [?MODULE, Upgrade]),"
When it doesn't work
=INFO REPORT==== 6-May-2015::20:16:08 ===
yaws_simple_bridge_anchorUpgrade:"websocket"
=INFO REPORT==== 6-May-2015::20:16:09 ===
yaws_simple_bridge_anchorUpgrade:undefined
This seems to be related to when the button is pressed on page.
When it does work
=INFO REPORT==== 6-May-2015::20:39:49 ===
yaws_simple_bridge_anchorUpgrade:"websocket"
So after trying to explain the situation fully. Is there a means to turn off websockets ? to confirm the problem (this is a full webpage with lot of javascript/css/images etc going through websocket so don't expect that supplying a sample page would work very well especially if you are running it locally).
Has anyone experienced this problem and maybe know of a work around or the issue?
Or can someone using yaws, last release of nitrogen, and running the webserver remotely confirm it is something with my setup?
Regards,
Stuart