Today, an unexpected bug has appeared in a web app I'm currently developing. Without making any changes to the code, this bug suddenly emerged:
I am sending AJAX requests (using vanilla JavaScript instead of jQuery) to our local server running MAMP PRO. Everything functions properly in Chrome and Firefox (testing on a Mac). However, when using Safari, the request consistently returns an error: Failed to load resource: the network connection was lost
If I manually try to access the URL of the request (not through AJAX), it works flawlessly. Upon testing the request with a setTimeout, I made an interesting observation:
When I make the request immediately after the page loads (within 60 milliseconds), everything works fine. After that, the connection is sporadically lost until around 6000 milliseconds, at which point it starts working again! This behavior is quite puzzling... considering I am not using any other setTimeouts, the issue seems to be specific to Safari.
Could this be a mistake on my end or just a newly discovered bug in Safari?