I have a web app which puts up some pictures, asks users to answer a few questions, and saves the data. Pretty simple. It’s been working great for a few years. Recently, it started failing again. The failure mode is interesting: some items on the web page will load, but some will not - for example, the Radio button set used for the survey question loads, but the image does not. Safari/mac is fine. On Windows 10, IE11 works fine, but Chrome and Edge don’t work. All of this is running over HTTPS.
What’s changed between the non-working and working situations?
I updated Xojo from 2014R2 to 2017R3
IE11 has probably not updated, but surely Chrome and Edge have.
An additional issue is that my server is sitting behind a dual-WAN router: when contacting the server, connections from the client to the server come in on a given IP address (a.b.c.D) but connections originating from the server to the client might be going out via a different IP address (a.b.c.E).
So it’s complicated: firewall rules on either the client or the server end could be impacting this.
My theory: I know that Xojo web apps use a lot of AJAX-like connections (using XMLHttprequest ??) where the server pings the browser, or the browser pings the server). I’m wondering if something has changed, either in Xojo 2017R3 or in the Chrome or Edge browsers? I seem to remember reading that Xojo web was using newer methods for this.
Zooming in, I searched the Output.log file for the session ID for one user (baker028). Even though I show 7 login attempts across a 3 second time period, from 17:05:02 through 17:05:05, the log doesn’t show anything that matches up:
The log seems to show what I would expect: keypresses in the user name field, followed by a Tab into the Password field, and then keypresses in the Password field. But nowhere do I show any actions which would trigger my Login() method 7 times. This is very weird.
I believe the problem is solved. For some reason, the latest Xojo in conjunction with recent web browsers seem more prone to generating multiple KeyPressed() events. My code was not expecting this, and therefore caused multiple logins and showing a webPage multiple times, which caused problems.
The solution was to code defensively, by adding a boolean flag so that my Login() routine could only be called once, and checking the time so that it was not called more than once per second. I just ran another test with multiple users and they had zero problems.