DashSoftwareSolutions / DashAccountingSystemV2

ASP.NET Core + React/Redux SPA powered Simple Ledger and Time Tracking System for small businesses
GNU General Public License v3.0
12 stars 4 forks source link

[UI] - MVP - Refactor Authorize Service to not hammer the back-end so much #20

Closed groberts314 closed 2 years ago

groberts314 commented 3 years ago

Figure out how to avoid excess calls to OIDC configuration and discovery endpoints when multiple callers are making async calls

image

groberts314 commented 3 years ago

https://stackoverflow.com/questions/5346694/how-to-implement-a-lock-in-javascript

This might be a promise-ing (see what I did there...? :-P) idea to only make OIDC configuration / discovery requests once even if multiple callers on multiple threads are all trying to do their thing at once.

Basically, ensureUserManagerInitialized() from being async/await to being Promise-based. Honestly, maybe the whole shebang should just be Promise-based instead of async/await.

groberts314 commented 2 years ago

Moved this into MVP. Really it needs to be fixed prior to using the tool fulltime. Especially when site doesn't load correctly and just kind of hangs (typically because access token has expired and we need to log in again).

We might also consider seeing if we can refactor to use Redux OIDC.

See also #27 (silent renew) - we might or might not decide that is also MVP! =)

groberts314 commented 2 years ago

I think as of 13a778f (which adds double-checked sync locking pattern to the Authorize Service and is pretty successful at cutting down the number of calls the the OIDC client settings and discovery endpoints) this might be good enough for MVP.

Consider making a new issue for any further enhancements and conversion of all of the authorization components to TypeScript.

groberts314 commented 2 years ago

Additional work beyond MVP will be a part of #96.