Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

Set lastRefresh on initial form load #906

Merged
merged 1 commit into from
Sep 27, 2018
Merged

Conversation

hursey013
Copy link
Contributor

@hursey013 hursey013 commented Sep 27, 2018

Fixes #895

The form looks for route changes to update the lastRefresh value (by way of onRouteChanged() > refreshToken() > updateApplication(): https://github.com/18F/e-QIP-prototype/blob/develop/src/views/Form/Form.jsx#L116-L127) however on initial load of the app this normal handling is skipped and instead simply redirects users to the intro page: https://github.com/18F/e-QIP-prototype/blob/develop/src/views/Form/Form.jsx#L51, never setting a value for lastRefresh. This uses React's componentDidMount() to run the refreshToken() method on initial render, setting an initial value for lastRefresh.

@codecov
Copy link

codecov bot commented Sep 27, 2018

Codecov Report

Merging #906 into develop will decrease coverage by 0.09%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           develop     #906     +/-   ##
==========================================
- Coverage    46.75%   46.66%   -0.1%     
==========================================
  Files          680      680             
  Lines        27427    27397     -30     
  Branches      3371     3371             
==========================================
- Hits         12824    12784     -40     
- Misses       14242    14250      +8     
- Partials       361      363      +2
Flag Coverage Δ
#backend 7.75% <ø> (-0.26%) ⬇️
#frontend 90.19% <ø> (ø) ⬆️
Impacted Files Coverage Δ
api/xml/xml.go 85.62% <0%> (-2.19%) ⬇️
api/location.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dba2836...e1d27ab. Read the comment docs.

Copy link
Contributor

@apburnes apburnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeouts now work as expected.

@ryanhofdotgov
Copy link
Contributor

@hursey013 Does componentDidMount() get called before or after the user successfully authenticates? For example, if I just open the front page and don't sign in for 20 minutes, what will the value of lastRefresh be?

@hursey013
Copy link
Contributor Author

@ryanhofdotgov it gets called after the form component is loaded which doesn't happen until after a successful login. From what I can see none of the timeout logic is activated on the login page itself.

@ryanhofdotgov ryanhofdotgov merged commit f0c685a into develop Sep 27, 2018
@ryanhofdotgov ryanhofdotgov deleted the bh_initial_timeout branch September 27, 2018 20:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants