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

fix: Session Expiration redirects for teams and enterprise #2889

Merged
merged 1 commit into from
May 22, 2024

Conversation

ajay-sentry
Copy link
Contributor

Description

A couple bug fixes in this PR, all centered around getting the session redirect to work properly for enterprise customers; and consequently non-enterprise customer regression fixes.

Fixes:

  • Incorrect redirect path set for enterprise causing infinite render
  • Removing unnecessary logic for rendering/mounting the SessionExpiryTracker component
  • Adding a cookie removal for the session_expiry amount if the user forces a sign out
  • Adding the expiry banner to the enterprise login page if the user has an expired session
  • Removing the sessionid cookie and redirect user after the session expiry value is elapsed

In the below videos we can see in the console the polling mechanism at play (I had to bump down the session expiry to a minute and the polling interval to 6 seconds to easily reproduce) for both enterprise and non-enterprise customers

Polling interval stuff in API is here: https://github.com/codecov/codecov-api/blob/c3f5e7f903c63f8a5eadc5a69a2846df57e65a0a/codecov_auth/views/github.py#L168

Screenshots

Screen.Recording.2024-05-20.at.2.21.03.PM.mov
Screen.Recording.2024-05-20.at.2.23.40.PM.mov

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@@ -10,6 +10,12 @@ const defaultConfig = {
GH_APP: 'codecov',
}

export const LOCAL_STORAGE_SESSION_EXPIRED_KEY = 'expired-session'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved these to shared consts for clarity and to remove all the redeclarations

@@ -104,6 +104,7 @@ A.propTypes = {
variant: PropTypes.oneOf([
'default',
'header',
'guestHeader',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was a propType fix error I was seeing in the console, unrelated to PR

@codecov-notifications
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2889      +/-   ##
==========================================
- Coverage   98.48%   98.47%   -0.01%     
==========================================
  Files         878      878              
  Lines       13027    13023       -4     
  Branches     3489     3470      -19     
==========================================
- Hits        12829    12825       -4     
  Misses        194      194              
  Partials        4        4              
Files Coverage Δ
src/config.js 100.00% <100.00%> (ø)
src/layouts/BaseLayout/BaseLayout.jsx 96.29% <ø> (-0.38%) ⬇️
...ts/EnterpriseLoginLayout/EnterpriseLoginLayout.tsx 100.00% <100.00%> (ø)
src/layouts/Header/Dropdown.tsx 100.00% <100.00%> (ø)
src/layouts/LoginLayout/LoginLayout.tsx 100.00% <ø> (ø)
src/ui/A/A.jsx 100.00% <ø> (ø)
...c/ui/SessionExpiryTracker/SessionExpiryTracker.tsx 97.50% <100.00%> (-0.18%) ⬇️
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.22% <100.00%> (-0.05%) ⬇️
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <ø> (ø)
UI 94.52% <100.00%> (-0.02%) ⬇️

Continue to review full report in Codecov by Sentry.

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

Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.47%. Comparing base (534ba5f) to head (2e412af).

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2889      +/-   ##
==========================================
- Coverage   98.48%   98.47%   -0.01%     
==========================================
  Files         878      878              
  Lines       13027    13023       -4     
  Branches     3494     3493       -1     
==========================================
- Hits        12829    12825       -4     
  Misses        194      194              
  Partials        4        4              
Files Coverage Δ
src/config.js 100.00% <100.00%> (ø)
src/layouts/BaseLayout/BaseLayout.jsx 96.29% <ø> (-0.38%) ⬇️
...ts/EnterpriseLoginLayout/EnterpriseLoginLayout.tsx 100.00% <100.00%> (ø)
src/layouts/Header/Dropdown.tsx 100.00% <100.00%> (ø)
src/layouts/LoginLayout/LoginLayout.tsx 100.00% <ø> (ø)
src/ui/A/A.jsx 100.00% <ø> (ø)
...c/ui/SessionExpiryTracker/SessionExpiryTracker.tsx 97.50% <100.00%> (-0.18%) ⬇️
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.22% <100.00%> (-0.05%) ⬇️
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <ø> (ø)
UI 94.52% <100.00%> (-0.02%) ⬇️

Continue to review full report in Codecov by Sentry.

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

Copy link

codecov bot commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.47%. Comparing base (534ba5f) to head (2e412af).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2889     +/-   ##
=======================================
- Coverage   98.48   98.47   -0.01     
=======================================
  Files        878     878             
  Lines      13027   13023      -4     
  Branches    3489    3425     -64     
=======================================
- Hits       12829   12825      -4     
  Misses       194     194             
  Partials       4       4             
Files Coverage Δ
src/config.js 100.00% <100.00%> (ø)
src/layouts/BaseLayout/BaseLayout.jsx 96.29% <ø> (-0.38%) ⬇️
...ts/EnterpriseLoginLayout/EnterpriseLoginLayout.tsx 100.00% <100.00%> (ø)
src/layouts/Header/Dropdown.tsx 100.00% <100.00%> (ø)
src/layouts/LoginLayout/LoginLayout.tsx 100.00% <ø> (ø)
src/ui/A/A.jsx 100.00% <ø> (ø)
...c/ui/SessionExpiryTracker/SessionExpiryTracker.tsx 97.50% <100.00%> (-0.18%) ⬇️
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.22% <100.00%> (-0.05%) ⬇️
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <ø> (ø)
UI 94.52% <100.00%> (-0.02%) ⬇️

Continue to review full report in Codecov by Sentry.

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

@codecov-staging
Copy link

Bundle Report

Changes will increase total bundle size by 153 bytes ⬆️

Bundle name Size Change
gazebo-staging-array-push 6.61MB 153 bytes ⬆️

@codecov-qa
Copy link

codecov-qa bot commented May 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.47%. Comparing base (534ba5f) to head (2e412af).

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2889      +/-   ##
==========================================
- Coverage   98.48%   98.47%   -0.01%     
==========================================
  Files         878      878              
  Lines       13027    13023       -4     
  Branches     3471     3470       -1     
==========================================
- Hits        12829    12825       -4     
  Misses        194      194              
  Partials        4        4              
Files Coverage Δ
src/config.js 100.00% <100.00%> (ø)
src/layouts/BaseLayout/BaseLayout.jsx 96.29% <ø> (-0.38%) ⬇️
...ts/EnterpriseLoginLayout/EnterpriseLoginLayout.tsx 100.00% <100.00%> (ø)
src/layouts/Header/Dropdown.tsx 100.00% <100.00%> (ø)
src/layouts/LoginLayout/LoginLayout.tsx 100.00% <ø> (ø)
src/ui/A/A.jsx 100.00% <ø> (ø)
...c/ui/SessionExpiryTracker/SessionExpiryTracker.tsx 97.50% <100.00%> (-0.18%) ⬇️
Components Coverage Δ
Assets 54.54% <ø> (ø)
Layouts 97.22% <100.00%> (-0.05%) ⬇️
Pages 99.28% <ø> (ø)
Services 99.48% <ø> (ø)
Shared 99.68% <ø> (ø)
UI 94.52% <100.00%> (-0.02%) ⬇️

Continue to review full report in Codecov by Sentry.

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

Copy link

codecov bot commented May 20, 2024

Bundle Report

Changes will increase total bundle size by 153 bytes ⬆️

Bundle name Size Change
gazebo-production-array-push 6.61MB 153 bytes ⬆️

@codecov-releaser
Copy link
Contributor

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
2e412af Mon, 20 May 2024 22:16:35 GMT Cloud Enterprise

@ajay-sentry ajay-sentry added this pull request to the merge queue May 22, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 22, 2024
@ajay-sentry ajay-sentry added this pull request to the merge queue May 22, 2024
Merged via the queue into main with commit 5d14229 May 22, 2024
59 of 60 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/464-session-expiry-fixes branch May 22, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants