sentry
sentry copied to clipboard
feat(ui): adds a request deduper
Basic prototype de-dupe infight requests by wrapping the promise and only evaluating it the URL matches. This only works for GET requests. Note this is not cache so if you re-refresh data then you'll get fresh data (assuming the other request is still not in-flight).
The design here all makes sense to me. The only potential issues I can think of are:
- GET requests with the same URL but different headers, like a different auth token (no idea if this would ever happen)
- If we don't have timeouts for long requests, I wonder if this could keep returning the same promise that will never return a value
@malwilley Good points
- I don't think it's possible to have different request headers in
requestPromise
. It's not an input to the function so we don't need it as part of the cache key. - We do have timeouts for long requests, should be 30 seconds. In either case, the problem caused by long-running requeests shouldn't be impacted by a request de-duper.
This pull request has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀