cfpb / hmda-frontend

Collection of HMDA frontend apps
Creative Commons Zero v1.0 Universal
12 stars 15 forks source link

Implement progress tracker with websockets #591

Open omnipresent07 opened 4 years ago

omnipresent07 commented 4 years ago

Short description explaining the high-level reason for the new issue.

The backend API exposes websockets now as part of this PR https://github.com/cfpb/hmda-platform/pull/3779 . The front end can open a websocket at the time of the upload to better track when the submission is completed.

meissadia commented 2 years ago
meissadia commented 2 years ago

Hitting a blocker with Websockets:

meissadia commented 2 years ago

I've been investigating setting the authorization header as part of the websocket connection request but it does not appear to be supported by web browsers.

Options

meissadia commented 2 years ago

Re: failed connection in DEV; onclose code 1006

Request Upgrade

http://nginx.org/en/docs/http/websocket.html https://www.nginx.com/blog/websocket-nginx/ https://github.com/grafana/grafana/issues/36929#issuecomment-954706911

lchen-2101 commented 1 year ago

set token with cookie to authenticate already works without changes to the backend; so the first option works, the cookie name is X-Authorization-Token, so below snippet will work before constructing the ws connection

document.cookie = `X-Authorization-Token=${AccessToken.get()}; path=/;`
meissadia commented 1 year ago

This associate Github issue was closed on HMDA Platform but it's not clear if anything was done to correct the underlying problem. This should be tested/validated as part of pre-rollout activities.

https://github.com/cfpb/hmda-platform/issues/4406