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 race condition in logOut. #1005

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

chr15m
Copy link

@chr15m chr15m commented Sep 19, 2023

This fixes a race condition where the session is saved but then modified again in the keepSessionInfo branch and the callback is called before save is called again. This patch issues a second save in the keepSessionInfo eliminating the race condition. Fixes #1004.

Checklist

  • I have read the CONTRIBUTING guidelines.
  • The automated test suite ($ make test) executes successfully.

I have left the following unchecked with an explanation:

  • The automated code linting ($ make lint) executes successfully.

When I ran make lint I encountered an error because jshint is expected on the path (as opposed to being installed by npm and being called with npx for example). When I added it to the path it threw several errors but none of them were related to this patch. These errors are all from the existing codebase. Maybe I have run this in error somehow or I'm missing a config file.

  • I have added test cases which verify the correct operation of this feature or patch.

I can't see how to replicate the failing condition in the current tests. I'm looking at request.test.js and I'm unsure how to simulate a backend which takes a while to set the values. Any guidance here welcome.

  • I have added documentation pertaining to this feature or patch.

I do not think any documentation changes will be necessary for this under-the-hood fix which will be transparent to the user.

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.

Race condition in logout function
1 participant