facebook / Rapid

The OpenStreetMap editor driven by open data, AI, and supercharged features
https://rapideditor.org
ISC License
521 stars 92 forks source link

Handle OSM API Timeouts #1487

Open bhousel opened 4 months ago

bhousel commented 4 months ago

Followup on #1304 We already handle a bunch of different error conditions with the OSM API.
But when things get really bad, we don't even get a response from the capabilities or any of the other calls, just a connection timeout:

Screenshot 2024-07-11 at 9 41 22 AM

We should handle this situation too.

bhousel commented 4 months ago

This relates to #1451 too where I said:

While we're at it, the AbortSignal can now have a timeout. This is a thing that all modern browsers support now - details. The default fetch timeout in Chrome is 300 seconds, but we should probably drop most requests after like 5-10sec.

The timeout should be quicker.

Some data taken during today's DDoS storm: Screenshot 2024-07-11 at 9 49 37 AM

2.4 minutes is kinda a long time to wait for a response 😆
After a few seconds we can cancel it and display the red bar of sadness.