Remove redundant "remaining" value from session timeout API (Part 1)#8084
Remove redundant "remaining" value from session timeout API (Part 1)#8084
Conversation
changelog: Internal, Session Timeout, Remove redundant timeout value from session timeout API
Temporary for first deploy, see https://github.com/18F/identity-idp/pull/8084/files#r1150918192
|
I'll take a closer look at the failing spec this afternoon. I suspect it's more to do with how it's stubbed in the feature specs, and the increased precision of the new |
1. Fixes specs 2. Better user experience, don't have to wait for request to finish before modal is closed, thus making app feel more responsive 3. The previous result handling with `success` would cause a second polling interval to begin
This is exactly what the issue was. I tried a few different approaches to resolving it, most of which required making the test run a little longer in real time to wait for the modal to appear. I went a different direction in 97265e2, which is something I was already proposing in #7966. Essentially, the idea is to close the modal immediately on click and optimistically assume a successful response. This makes the app feel more responsive, and also avoids a bug where a duplicate polling interval is started for every time the user clicks "Keep me signed in". In the worst case, the next polling ping 30 seconds later would show the modal again if the keepalive request was unsuccessful for some reason. |
The CSRF won't be updated until after the request finishes, even if the modal will be disappeared immediately
🛠 Summary of changes
Extracted from #7966
Removes the
remainingvalue from the session active / keepalive endpoints. This is an iteration toward a refactoring of session timeout behaviors, partially implemented in #7966.The
remainingvalue is unnecessary since, just as it was computed server-side, it can be derived on the client-side by comparing thetimeoutand current time. Arguably this would produce a more accurate value, since it would not be subject to time drift delays in the same way that a network response would be.📜 Testing Plan
timeRemainingis used to schedule the final polling request if the session inactivation would occur sooner than the regularly scheduled pollIt's easier to test by setting a very low session timeout in local
config/application.yml: