The revocation_reason stored on the DB on a logout action differs from the one specified on the DB schema; 1 is stored instead of 0.
To Reproduce
Steps to reproduce the behavior:
Go to 'Moonfire UI'
Click on 'Login'
Authenticate with user/password
Click on 'User icon' on top right corner
Click on 'Logout'
Check user_session DB table data
Note all revocation_reason are set to 1 where the sessions were ended through Logout:
$ sqlite3 db/db "select use_count, last_use_time_sec, revocation_reason, revocation_time_sec, revocation_reason_detail from user_session order by creation_time_sec;"
3|1688842276|1|1688842276|
5|1688843878|1|1688843878|
15|1688843589|1|1688843589|
7|1688843823|1|1688843823|
5|1688843840|1|1688843840|
12|1688844227|1|1688844227|
12|1688845438|1|1688845438|
10|1688845421|1|1688845421|
9|1688845473|1|1688845473|
7|1688845430|1|1688845430|
5|1688845411|1|1688845411|
11|1688846726|1|1688846726|
10|1688857966|1|1688857966|
Expected behavior
The revocation_reason should match what we have in the specification, so far that value is 0. So we need to either correct the spec or the storage of that value for the correct representation and later categorization of sessions' ending reasons, this would also come handy during troubleshooting.
Screenshots
N/A
Server (please complete the following information):
If using Docker: docker ps + docker images
$ docker ps -f name=moonfire-nvr
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6172c6e74ad6 scottlamb/moonfire-nvr:v0.7.6 "/usr/local/bin/moon…" 5 hours ago Up 5 hours moonfire-nvr
$ docker images |grep moonfire
scottlamb/moonfire-nvr v0.7.6 90a65a3c7999 6 hours ago 306MB
Camera (please complete the following information):
N/A
Desktop (please complete the following information):
N/A
Looks like the actual code and the comment are inconsistent; I think I'll just update the comment to match the code to fix this without requiring a migration.
Describe the bug
The
revocation_reason
stored on the DB on a logout action differs from the one specified on the DB schema;1
is stored instead of0
.To Reproduce Steps to reproduce the behavior:
user_session
DB table dataNote all
revocation_reason
are set to1
where the sessions were ended throughLogout
:Expected behavior The
revocation_reason
should match what we have in the specification, so far that value is0
. So we need to either correct the spec or the storage of that value for the correct representation and later categorization of sessions' ending reasons, this would also come handy during troubleshooting.Screenshots N/A
Server (please complete the following information):
docker ps
+docker images
Camera (please complete the following information): N/A
Desktop (please complete the following information): N/A
Additional context
Noticed while investigating https://github.com/scottlamb/moonfire-nvr/issues/277