Modify Session Timeout Logic#8074
Conversation
Coverage Report for CI Build 30213359923Coverage decreased (-0.005%) to 90.467%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
david-yz-liu
left a comment
There was a problem hiding this comment.
Nice work @mrafie1, this PR looks great. You raised a great question about the "post-login" calls to check_timeout. It would be great to extend this PR to also stop calls to check_timeout after a forbidden status has been provided and the "redirect to login" modal appears.
…t but still on page
|
From slack: Screen.Recording.2026-07-24.at.21.51.34.movThis is because the user is only forwarded to the "session expired" modal when they press "continue" and the server sends a 403 response, which I can pick up with my listener. Does your comment on github also encompass this issue? If so, is there a way to actually detect when the user should be timed out without using a 403 response? |
|
Hi @mrafie1, please modify the |
|
Video of changes: Polling period is 5 seconds and timeout period is 20 seconds. screenrec1.mov |
| let intervalId; | ||
| let sessionExpired = false; | ||
|
|
||
| $(document).ajaxError((event, xhr) => { |
There was a problem hiding this comment.
I'd rather not introduce this as a global handler, but instead attach it directly to the fetch request to check_timeout.
Related to this, please modify the existing code to use the native fetch instead of $.get
|
Proposed Changes
intervalIdvariable to track whether polling is occurring (whenever setInterval() is called)startPollingfunction to replace the logic of the previous implementation ofdomContentLoadedCBfunctionstopPollingfunction to callclearIntervalto pause pollingScreenshots of your changes (if applicable)
This had audio explaining how I tested my changesScreen.Recording.2026-07-21.at.21.31.02.mov
Type of Change
(Write an
Xor a brief description next to the type or types that best describe your changes.)Checklist
(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the
[ ]into a[x]in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)Before opening your pull request:
After opening your pull request:
Questions and Comments
(Include any questions or comments you have regarding your changes.)
Whenever a user is forcibly logged off due to an expired session but still remains on the MarkUs screen and doesn't redirect themselves to the "log-in" page, polling still occurs (this was tracked using console.log() statements). Is this intended?
Do I need to update any documentation for this change? I wasn't able to find a section in the documentation that seemed relevant.