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

Investigate anonymous user id discrepancy #150

Open
sampaccoud opened this issue Dec 10, 2019 · 2 comments
Open

Investigate anonymous user id discrepancy #150

sampaccoud opened this issue Dec 10, 2019 · 2 comments

Comments

@sampaccoud
Copy link
Contributor

sampaccoud commented Dec 10, 2019

Our Sentry is getting spammed by the same repeating error:

Stored anonymous user id <SimpleLazyObject: <User: insider>> for user None in course u'rrrssstttuuuvvvwwwxxxyyyzzz' doesn't match computed id u'aaabbbcccdddeeefffggghhhiii'

We had to silence it fast in order to avoid bursting our events quota on Sentry, so we commented out the piece of code that logs the error: see PR openfun/edx-platform#56.

However, eventhough these errors do not seem to affect our users, we should take the time to understand it and fix it at its root.

@rmoch
Copy link
Contributor

rmoch commented Feb 24, 2020

@sampaccoud we can close this one, right ?

@sampaccoud
Copy link
Contributor Author

Not really because there is really something wrong in the way edX handles anonymous user ids:
https://github.com/edx/edx-platform/blob/master/common/djangoapps/student/models.py#L195

The anonymous id changes every time you modify your Django SECRET_KEY setting.

I think when the Django secret key changes, existing user anonymous ids should not change... so the anonymous_id_for_user method should return the existing anonymous id and not the digest computed with the current Django secret key.

If edX wanted the anonymous id to change with the secret key, they shouldn't have persisted it to the database... What they do is not coherent. Raising a warning does not solve it and adds to the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants