-
Notifications
You must be signed in to change notification settings - Fork 814
Check unusable device on user_auth plugin #13759
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
base: develop
Are you sure you want to change the base?
Check unusable device on user_auth plugin #13759
Conversation
Build Artifacts
|
92888d6
to
b207005
Compare
b207005
to
3be12eb
Compare
kolibri/core/device/utils.py
Outdated
device_is_provisioned = False | ||
|
||
|
||
def is_provisioned(): | ||
# First check if the device has been provisioned | ||
global device_is_provisioned | ||
device_is_provisioned = device_is_provisioned or device_provisioned() | ||
return device_is_provisioned | ||
|
||
|
||
def reset_device_provisioned_flag(): | ||
global device_is_provisioned | ||
device_is_provisioned = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You didn't add this code, but I have some confidence this will not create the desired effect in the Android app. The global variable used as a cache is problematic in situations where tasks and the the server are run in different processes, such as the Android app and BCK (not a LOD use case, I know).
It isn't clear to me from the original PR whether this was added to improve performance, but DeviceSettings
, where the provisioned status is stored, has a caching layer. It seems like it might have been added to sidestep the database being ready. If we haven't already, I would try removing this global flag to see whether there is any detriment. I think it would be much better to have this gone then to keep it around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yes, nice catch! I forgot the tasks run in a different process in the Android App. I can try removing this global variable and see how it goes!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
28ad678
to
bd35f6a
Compare
Summary
deprovision
command logic to be a utils module so it can be reused in the command and in an async task.FacilityUsers.objects.get
to support soft-deleted and hard-deleted syncs.Grabacion.de.pantalla.2025-10-01.a.la.s.1.19.22.p.m.mov
References
Closes #13397
Notes