sentry icon indicating copy to clipboard operation
sentry copied to clipboard

feat(ui): adds a request deduper

Open scefali opened this issue 2 years ago • 1 comments

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).

scefali avatar Jul 22 '22 23:07 scefali

The design here all makes sense to me. The only potential issues I can think of are:

  1. GET requests with the same URL but different headers, like a different auth token (no idea if this would ever happen)
  2. 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

  1. 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.
  2. 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.

scefali avatar Aug 03 '22 19:08 scefali

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 🥀

github-actions[bot] avatar Aug 25 '22 00:08 github-actions[bot]