Open bhousel opened 4 months ago
@bhousel what implications does this have for the user's experience in Rapid?
what implications does this have for the user's experience in Rapid?
When the bug is triggered, it would show up as a missing square of OSM data that never loads.
I feel like I might have encountered this. Do you have a rough idea of how often this might occur?
I feel like I might have encountered this. Do you have a rough idea of how often this might occur?
I'm not sure - it would probably depend on how much scrolling and zooming the user is doing.
This code is in the OSM service, but we might have this issue in other places where we fetch data..
https://github.com/facebook/Rapid/blob/acdc46935275e7b2869f38182a7441db94f2f075/modules/services/OsmService.js#L366-L375
This is unfortunately because we are mixing Promise and callback style code. When the fetch is aborted, it returns and skips calling the errback, (amusingly the comment says
// ok
). The errback is where the request would be removed from the_tileCache.inflight
cache .What we really should do is:
fetch
should have afinally
block to remove the request from the inflight cache.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.