-
Notifications
You must be signed in to change notification settings - Fork 45
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
FIX: Partial Loading of Different Screen before the Login Alert Page upon Token Expiration #2683
Conversation
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2683 +/- ##
==========================================
+ Coverage 76.41% 76.43% +0.01%
==========================================
Files 299 299
Lines 9372 9390 +18
Branches 2024 2027 +3
==========================================
+ Hits 7162 7177 +15
- Misses 1572 1574 +2
- Partials 638 639 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Updated Video Preview (Ignore the laggy interface, I am running it on a VM) |
Let's discuss this in the call tomorrow. |
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
638d650
to
321690e
Compare
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
fed9601
to
b5b5e52
Compare
Signed-off-by: Snehil Shah <130062020+Snehil-Shah@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please resolve merge conflicts and feedbacks. Otherwise looks good. Will merge after the changes are done
// it('it should render <Login /> component and try to renew token if session has expired', async () => { | ||
// vi.mock('services/AuthService', async (importOriginal) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented test case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdshamoon I actually needed some help with that, this test and the test above it, are both correct. but I think their mocks are conflicting.
when I comment one of them out, the other one works (so the tests are definitely correct), but both of them don't work together, I tried to resetAllMocks
beforeEach, but still am not able to make it work
Signed-off-by: Snehil Shah <snehilshah.989@gmail.com>
@Snehil-Shah closing this in favor of #2829. Integration tests were not running against a forked branch. So created a separate branch with these changes. Overall looks good. Merging it after the tests run successfully. FYI for the test case: vi.mock does not work specific to a test. It updates the module for the whole file. So if you used it twice it picks up the latest one for both the test cases. A better way is to use vi.spy which I have added in the PR. |
Fixes #2671
Summary
Upon login token expiration, the app now gracefully loads the Login expired alert, instead of partially loading a different page
Test Plan
I actually had some problem in reproducing the login token expiration behaviour in development.
So I took the approach of corrupting the Session's cookie from the devtools by changing the expiration date & renewal token ids to imitate token expiration.
This might be the reason the "Before" recording looks different (and worse) than the recording in the original issue.
I think it should work the same for actual token expiration in production as it relies on the function
checkAuthStatusService
which primarily checks for token expiration and it handles it pretty well.I have attached video demos of this issue before & after this PR:
Before (watch till the end)
After