New users - Newly created users are not displayed in the table if the device's date is in the past
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Observed behavior
If I have installed Kolibri on a device which is not connected to the internet and the device's date and time are set in the past, then when I create any new users they are not shown in the 'New users' table. If I go to the 'User's table I can see that the newly created users are present there. This can be very confusing, especially if the admin is not aware that this is caused by the discrepancy between the device's date and time and the actual current date and time.
https://github.com/user-attachments/assets/e4c99929-677e-49d9-8317-ad038256f8d1
Expected behavior
Should be further discussed.
Steps to reproduce the issue
- Install the build from https://github.com/learningequality/kolibri/releases/tag/v0.19.0-beta2
- Make sure that the device is not connected to the internet and the date is set to at least 31 days prior to the current date
- Create a new user
Usage Details
Kolibri 0.19.0b2 Windows 11, Ubuntu 22, Mac OS 15.5 - Chrome, Firefox
@radinamatic
Great catch! 👏🏽 🕵🏽 🌟
The culprit is here: https://github.com/learningequality/kolibri/blob/develop/kolibri/plugins/facility/assets/src/views/users/NewUsersPage.vue#L254
Using the browser's timestamp, instead of using the server's timestamp.
To correct this, we should be using the now function from https://github.com/learningequality/kolibri/blob/develop/packages/kolibri/utils/serverClock.js
I guess, the other alternative would be to change the API filter to be based on relative time older_than_days - but just using the server clock may be simpler.
datetime in computer programming strikes again!