Timeout image loading in case of hanging connections - #13409
Conversation
|
dylanjeffers
left a comment
There was a problem hiding this comment.
chill, do we want to do shorter time, like 5?
raymondjacobson
left a comment
There was a problem hiding this comment.
awesome. i think we'll need a mobile equivalent here:
| img.onerror = () => reject(new Error(`Failed to load ${url}`)) | ||
|
|
||
| const timer = setTimeout(() => { | ||
| img.src = '' // stop loading if still in progress |
There was a problem hiding this comment.
just want to make sure this doesn't trigger a request to audius.co or something when src is set to '' instead of undefined (im not sure, just asking)
There was a problem hiding this comment.
AFAICT from searching it will not trigger any request if the source attribute is empty, and nothing weird happened even after the timeout is hit
The only concern I would have is app performance on slow wifi/cellular. But maybe if it takes longer than 5 seconds to load a 1000x1000 jpg, then the app might be unusable anyway. Happy to shorten it |
This reverts commit 3cec38a.
We're going to need to tackle mobile timeouts in a separate PR, the process is way more complicated because it involves using FastImage.preload so the same timeout structure doesn't work. |
[16d4c68] [PE-7289] Add artist social links on coin create (#13435) Dylan Jeffers [714814d] [PE-7320] Add copy link coin overflow option (#13440) KJ [108cdc1] [PE-7335] Increase slippage to 2% (#13432) Dylan Jeffers [8a59173] [PE-7025] Fix optimistic fee claiming not working (#13431) JD Francis [5e6438e] [PE-7336] Fix stripe mobile on-ramp visibility (#13439) Dylan Jeffers [c6488b4] Revert "Increase max file size for uploads (#13430)" (#13436) Marcus Pasell [f0d22bf] Drop trading volume launch banner (#13434) Dylan Jeffers [e2d6f9e] Increase max file size for uploads (#13430) Marcus Pasell [e16832d] [PE-7286] Update portfolio balance error text color (#13429) Dylan Jeffers [92ee20d] [PE-7324] Prevent portfolio balance hovering from swiping page (#13426) Dylan Jeffers [d520d7b] [PE-7287] Fix artist-coin description color (#13425) Dylan Jeffers [c1bc62d] [PE-7315] Drop verify flow (#13410) Dylan Jeffers [beb486a] [PE-7148] Update Upload coin gated track button to populate initial form data (#13424) KJ [0bc129c] [PE-7121] Add tooltip for coin price in insights section (#13422) KJ [12cbd20] [PE-7196] Fix coin balance loading state (#13420) KJ [3c24888] [PD-488] Fix spacing in the coin details right section (#13423) KJ [20f30bc] Version Packages (#13416) github-actions[bot] [5c7cc68] [PE-7322] Fix comment reply right padding (#13417) KJ [6fea43f] [PE-7325] Fix tip $AUDIO balance large after swap to $AUDIO (#13415) Reed [74098b3] [PE-7288] Update edit coin description field height (#13413) KJ [1f84141] Timeout image loading in case of hanging connections (#13409) Danny [6fd0a97] Add DOM test output on web-test failures (#13383) JD Francis [0fd54bc] [PE-7316] Update artist coin hover card width (#13412) Dylan Jeffers [950757b] [PE-7315] Fix remix contest winners index (#13397) Dylan Jeffers [09d0bbb] [PE-7204] Associate external wallet after swap (#13411) Dylan Jeffers [6173e94] Format tickers for urls and hooks (#13402) KJ [a0125db] Filter out unsupported challenges from notifs (#13408) Reed [48ccd99] Drop photo requirement text (#13407) Dylan Jeffers [23d315d] Fix takeover cta (#13406) KJ [9a0cc8c] css lint fixes (#13405) KJ [f8e35fc] Artist takeover (#13403) KJ [a705fcd] Add banner (#13404) KJ [cb4c07e] Ensure the token mint is set correctly in meteora dbc swaps (#13401) Marcus Pasell [16da7c3] Fix bundlesize check (#13400) Dylan Jeffers [6395893] Revert "[PE-7239] Fix issues due to stale local storage data (#13311)" (#13396) Dylan Jeffers [2b8e0c9] [PE-7312] Update announcement notifs to link from notif data (#13395) KJ [f96f996] Fix user track filter type (#13394) Dylan Jeffers [83bcf85] [PE-7307, PE-7308] Add coin redeem pages (#13390) KJ
Description
Some nodes might be down/unreachable in a way that causes connections to hang open indefinitely. This creates a default 10 second timeout for loading images before timing out to allow the fetcher to move on to the next mirror.
How Has This Been Tested?
Ran local web stack against a prod track. The track's artwork was stored on a node that creates hanging connections. The timeout triggered after the 10 second default and the artwork loaded quickly once the fetcher was able to try the next working mirror.