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

dubious check in redis store #19

Closed
clementauger opened this issue Aug 15, 2020 · 1 comment
Closed

dubious check in redis store #19

clementauger opened this issue Aug 15, 2020 · 1 comment
Labels

Comments

@clementauger
Copy link
Contributor

hey,

in the redis store GetSession method, the statement that verifies that the retrieved handle form redis is not empty is dubious.

In the case the user has not provided an username, which he might do, then the session he opened can never be retrieved.

See this line https://github.com/knadh/niltalk/blob/master/store/redis/redis.go#L164

I have not run manual testing to check for it, though i had to remove the corresponding statement in the memory store i have written.

So i guess this applies to the redis store too.

@knadh
Copy link
Owner

knadh commented Aug 17, 2020

Ah yes. There should not be a session without a handle in the first place. A handle should be auto-generated if one's not specificied here: https://github.com/knadh/niltalk/blob/master/handlers.go#L115

@knadh knadh added the bug label Aug 17, 2020
clementauger added a commit to clementauger/niltalk that referenced this issue Aug 18, 2020
@knadh knadh closed this as completed in 5c21d5d Aug 25, 2020
knadh added a commit that referenced this issue Aug 25, 2020
Fix #19 automatically generate an user handle if it is empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants