Skip to content

Conversation

@jaissica12
Copy link
Contributor

@jaissica12 jaissica12 commented Nov 5, 2025

Background

  • Session timeout calculations were duplicated in initialize() and endSession() methods
  • Both methods checked for session timeout but used different approaches:
    • initialize() used Date object comparison
    • endSession() used millisecond arithmetic with inverted logic
  • Session end operations (logging event, clearing data, nullifying session) were scattered inline within endSession()

What Has Changed

  • Added performSessionEnd helper - Extracted session end operations into a dedicated function
  • Added hasSessionTimedOut helper - Consolidates duplicate session timeout calculation logic

Screenshots/Video

  • {Include any screenshots or video demonstrating the new feature or fix, if applicable}

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • The original code used different comparison operators:
  • initialize() used > - session expired after 30:00.000
  • endSession() used >= - session expired at 30:00.000

As of now I have standardized on >=, let me know if you think otherwise

Reference Issue (For employees only. Ignore if you are an outside contributor)

@jaissica12 jaissica12 marked this pull request as draft November 5, 2025 15:37
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 1, 2025

@jaissica12 jaissica12 marked this pull request as ready for review December 1, 2025 14:39
@jaissica12 jaissica12 requested a review from rmi22186 December 1, 2025 14:42
@jaissica12 jaissica12 changed the base branch from development to blackout2025 December 3, 2025 17:31
@jaissica12 jaissica12 changed the base branch from blackout2025 to development December 3, 2025 17:32
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.

2 participants