Skip to content

Fix/3451 duplicate session upon login #4337

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

Merged
merged 3 commits into from
Nov 11, 2017

Conversation

flovilmart
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Nov 11, 2017

Codecov Report

Merging #4337 into master will decrease coverage by <.01%.
The diff coverage is 90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4337      +/-   ##
==========================================
- Coverage   92.52%   92.52%   -0.01%     
==========================================
  Files         118      118              
  Lines        8258     8267       +9     
==========================================
+ Hits         7641     7649       +8     
- Misses        617      618       +1
Impacted Files Coverage Δ
src/RestWrite.js 93.32% <90%> (-0.08%) ⬇️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 96.5% <0%> (-0.12%) ⬇️
src/Adapters/Auth/meetup.js 89.47% <0%> (+5.26%) ⬆️

Continue to review full report at Codecov.

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

@@ -3453,4 +3453,34 @@ describe('Parse.User testing', () => {
done();
});
});

it('does not duplicate session when loggin in multiple times #3451', (done) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

loggin should be *logging

}
return Promise.all(promises);
}).then(() => {
// wait because session destruction is not syncrhonous
Copy link
Contributor

Choose a reason for hiding this comment

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

typo in syncrhonous

while(promises.length != 5) {
Parse.User.logIn('yolo', 'yolo')
promises.push(Parse.User.logIn('yolo', 'yolo').then((res) => {
// generate a new session token every times
Copy link
Contributor

Choose a reason for hiding this comment

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

kinda weird wording in comment but not that big of a deal

montymxb
montymxb previously approved these changes Nov 11, 2017
Copy link
Contributor

@montymxb montymxb left a comment

Choose a reason for hiding this comment

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

👍 . The diff looks to be due to some 'now' unused code, was catching that which this is now accounting for. With that in mind I think this is good as is.

@flovilmart
Copy link
Contributor Author

we / I need to refactor at some point UserRouter (too many things) and Session creation as spread all across the project (lot of duplicated boilerplate).

@montymxb
Copy link
Contributor

Yeah, some consolidation is long overdue! I would be more than willing to help out with that, good amount that could be cleaned up. Lot to expect from one person ☝️.

@flovilmart flovilmart merged commit 72e20be into master Nov 11, 2017
@flovilmart flovilmart deleted the fix/3451-duplicate-session-upon-login branch November 11, 2017 14:41
UnderratedDev pushed a commit to UnderratedDev/parse-server that referenced this pull request Mar 21, 2020
…y#4337)

* Adds failing test for parse-community#3451 (on multiple logins)

* Factor sessionDestruction as part of Session creation flow in RestWrite

* nits
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