Skip to content

fix: active session not clearing on tab close (Mac/Windows) - #3952

Open
SomeshG1151 wants to merge 1 commit into
JdeRobot:humble-develfrom
SomeshG1151:fix/active-session-not-clearing
Open

fix: active session not clearing on tab close (Mac/Windows)#3952
SomeshG1151 wants to merge 1 commit into
JdeRobot:humble-develfrom
SomeshG1151:fix/active-session-not-clearing

Conversation

@SomeshG1151

Copy link
Copy Markdown

Fixes #3510

Root cause: beforeunload fetch/beacon is dropped by Chrome on Mac/Windows
before reaching the server, leaving active_project set permanently.

Changes:

  • Project.tsx: replaced beforeunload with pagehide which fires reliably
    on all platforms including Mac/Windows on tab close and navigation
  • Project.tsx: fixed removeEventListener bug — was passing a new anonymous
    function each time so the listener was never actually removed
  • views.py: re-enabled the active_project session check that was temporarily
    disabled in Disable active project check for now #3514, now that cleanup is reliable
  • views.py: fixed typo "Alredy" → "Already"

…on Mac/Windows

- beforeunload beacon is dropped by Chrome on Mac/Windows before reaching server
- pagehide fires reliably on tab close and navigation on all platforms
- fixed removeEventListener bug (was passing new anonymous fn, never actually removed)
- re-enabled active_project check in views.py with typo fix

Fixes JdeRobot#3510
@javizqh

javizqh commented Aug 1, 2026

Copy link
Copy Markdown
Member

Missing video evidence of the fix working on Chrome and Firefox

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.

Active Session Warning Even After Exercise Is Closed.

2 participants