Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue xhr requests until auth completed #58

Open
timwis opened this issue Oct 26, 2016 · 1 comment
Open

Queue xhr requests until auth completed #58

timwis opened this issue Oct 26, 2016 · 1 comment

Comments

@timwis
Copy link
Member

timwis commented Oct 26, 2016

In index.js we're currently breaking the choo paradigm by firing an xhr request out in the wild, before even initialising the app. This is necessary because all the subsequent requests depend on the session that should be set by that initial request.

I was thinking that one of the only other ways to accommodate this would be to "queue" any subsequent xhr requests until the initial auth request is completed (since subsequent requests happen asynchronously). I thought it was crazy, but @yoshuawuyts just thought of the same thing, so maybe it's not so nuts. We'd just want to ensure that queuing is explicit so there's no magic, ie.

xhr({uri: '...'}, waitForAuth=True)

(but, ya know, in javascript not python)

This is definitely "backlog"

@yoshuawuyts
Copy link

Sibling issue here dat-ecosystem-archive/datBase#306 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants