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

Implement progress tracker with websockets #591

Open
omnipresent07 opened this issue Jul 31, 2020 · 6 comments · May be fixed by #1200
Open

Implement progress tracker with websockets #591

omnipresent07 opened this issue Jul 31, 2020 · 6 comments · May be fixed by #1200
Assignees
Labels
Backlog Enhancement New feature or request filing

Comments

@omnipresent07
Copy link
Contributor

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

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

@meissadia
Copy link
Contributor

meissadia commented Mar 17, 2022

  • Direct users to the latest step that needs action
  • Remove "verified" from the EditsNav if they did not trigger those edits
  • Remove "verified" from the SubmissionNav if they did not trigger those edits
  • Simulate progress

@meissadia
Copy link
Contributor

meissadia commented Mar 28, 2022

Hitting a blocker with Websockets:

  • When running locally, unsecured websocket connections succeed ws://
  • When deployed to DEV, the frontend cannot make an unsecured connection ws:// from a secure domain https://
  • Deployed to DEV with secure sockets wss:// but the connection immediate fails, so this may not be supported by the Platform?

@meissadia meissadia added the blocked Waiting on other work to be completed. label Mar 29, 2022
@meissadia
Copy link
Contributor

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

  • Send bearer token as a cookie https://stackoverflow.com/a/48618910
    • Pro: Might work
    • Con: Backend would need modification to look for token in an unexpected place
  • Send headers onOpen https://stackoverflow.com/a/59796300
    • Pro: Would allows us to securely send our auth info
    • Con: Would require adjustment on the backend to support a modified auth flow
  • Misuse the protocol parameter of the websocket to send the auth token https://stackoverflow.com/a/44314168
    • Pro: Simple to implement on the Frontend
    • Con: Would this be sent in the open? Is it secure?
    • Con: Backend would need modification to look for the auth token in an unexpected place
  • Configure separate auth token generation for websocket connections https://stackoverflow.com/a/52749848
    • Pro: Might actually work
    • Con: Would require the development of a new backend service
    • Con: Complex integration needed on both ends
  • Send token as a URL parameter https://stackoverflow.com/a/42596786
    • Con: Token could be intercepted and abused

@meissadia meissadia removed blocked Waiting on other work to be completed. 2022 Filing Season After Filing Season labels Aug 31, 2022
@meissadia
Copy link
Contributor

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/
grafana/grafana#36929 (comment)

  • We've applied to the config to send the upgrade requests, issue persists

@lchen-2101
Copy link
Contributor

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
Copy link
Contributor

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.

cfpb/hmda-platform#4406

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog Enhancement New feature or request filing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants