jac241 / anki_killstreaks

A Halo and Call of Duty inspired add-on to gamify Anki and make reviewing more bearable
GNU Affero General Public License v3.0
17 stars 8 forks source link

I was someone else (occurred twice) #16

Closed AgirlhasN0name closed 4 years ago

AgirlhasN0name commented 4 years ago

I made an account as Agirl_hasN0name and I never received a verification email. Yesterday I noticed my score didn't match my rating and the same thing happened today. As I was going through my reviews I stopped to edit a card and when I returned I had randomly switched to a score of 977, rank 96 under "jonweih". Not sure why but the same thing happened yesterday. I just logged out as soon as I noticed. I wish I had more info, but no errors came up. Just thought I would let you guys know to check what's going on. This is an awesome addon by the way, thank you so much for all the effort and hard work you guys put into making this!

khonkhortisan commented 4 years ago

Both of those names were my rival, I may have been following you at the time.

jac241 commented 4 years ago

I found a race condition that might have resulted in you being shown as a different user in chase mode during reviews. @khonkhortisan , I'm still at a loss why you would have been logged in as someone else unless there is a threading issue with the library I used. It seems that people are only experiencing this issue when the site is having performance problems, which would accentuate the race condition for chase mode.

cmwfuchs commented 4 years ago

I had the same issue just now while reviewing under "BlastaMasta". My score was equal to that of the No. 1 Daily Reviewer "Pikapaka" and my rank was also set to 1. When checking the Profile Settings I noticed that it showed me an unknown @gmail.com e-mail-address. I was able to log out and back in with no issues.

jac241 commented 4 years ago

Let me know if any of you experience this again. I've made a change to the server that will hopefully address this issue, but it's hard to know for sure because it is intermittent and hard to track down.

AgirlhasN0name commented 4 years ago

It just happened to me again unfortunately

jac241 commented 4 years ago

How about in the past week. Anyone experience this? I removed a library that I think may have been responsible, but as always it's hard to tell b/c this is so intermittent.

AgirlhasN0name commented 4 years ago

It happened to me yesterday once (sometime in the afternoon EST, not sure the exact time though). I logged out immediately and logged back in with my profile. When did you make the change? (Also thank you so much for working on this, it's the best anki add-on!)

jac241 commented 4 years ago

Shoot. I made the change probably a week ago. I've got one more thing to try before I just rip the authentication library I'm using out and write my own which I really wanted to avoid. Thanks for the kind words. I literally had a nightmare last night about this issue where I was refreshing the page and my username kept changing so I think I've about had it lol.

jac241 commented 4 years ago

This is definitely still occurring. I will make changes to authentication system, pulling out devise_token_auth and just persisting the standard devise session in the killstreaks db on the Anki client. Unfortunately this will require logging in again on the anki add-on and will necessitate coming up with a message for people who have not updated to the latest AnkiKillstreaks version, so hang tight, it might be a little bit until I can get this work done.

jac241 commented 4 years ago

I think I found and fixed the root cause of this problem. If two users' killstreaks add-on made a request to the server at nearly exactly the same time (within 20ms of each other, which is how long most of the requests take to respond), the response to the second could overwrite the first, and therefore could log you in as someone else. I tracked this down to a thread safety issue within one of the libraries I was using on the server.

Let me know if this occurs for any of you again. I am hopeful the issue is resolved though.