CodeForPhilly / CodeForPhilly/stately

Queue xhr requests until auth completed

Open
#58 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
22
Forks
5
PR merge metrics
No merged PRs in 30d

Description

In [index.js](https://github.com/CodeForPhilly/stately/blob/master/client/src/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.

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

(but, ya know, in javascript not python)

This is definitely "backlog"

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in client/src/index.js and trace the initial auth request and later xhr calls. Clarify with maintainers how explicit wait-for-auth behavior should work and what requests it covers. Done means dependent requests wait until authentication completes without relying on implicit behavior; the issue names no tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.