You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
KeyBackup: Int instead of boolean when using sqlite #6977
When using sqlite db, as when using the demo script, keys backup requests
GET /_matrix/client/r0/room_keys/keys
return integer 0 or 1 for "is_verified" field.
Checking in the homeserver.sql file, we have:
sqlite> .dump e2e_room_keys
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "e2e_room_keys" ( user_id TEXT NOT NULL, room_id TEXT NOT NULL, session_id TEXT NOT NULL, version BIGINT NOT NULL, first_message_index INT, forwarded_count INT, is_verified BOOLEAN, session_data TEXT NOT NULL );
INSERT INTO e2e_room_keys VALUES('@alice_1548254180889ff0df4f9-254c-43ff-996f-82bf99814e0d:localhost:8480','!tnFrsAWORkbEsLMFMt:localhost:8480','QkA5mEsnmg5irnRwV7E1DiGioSFiFKC0gWikaZVNw0w',1,0,0,1,'{"ciphertext": "dMCa5hP4M25FYhC+JsQQzZ9QGH2SWlW66GsbNCSkgG75Gnv8dxFd/RtCKGVCMSI83Pv1eKWd5iXOm0fsoi09gy8t+0KO1a63KyUfjWaq8G/dPP7vxgUj+lonFpCFxjX1yGjBj2+buj5OBFl1s0wYAMzbqzfVhrYQQykvFfBCDCo9D01tSc/ieOyaQoHm+b6UC7xNZMpXOuqKR5MogQXbsCh3wD/pKxyGyBeEzGIl/hJbU7b7LDVhdxzv5HMlzqC4bkCE0ALf+KXrB7fkiD8JlWubEBOVq1DslVSw/04w/cO/DG6GQ8zLWaiRm8HG0zzOE1mdYsTjqCbhxJkp6bp6oJc8KXDlcJOyOp3BKDln1mHhZrm5RxtwWpO/eU7B7TPw3Ui7PxH0Z/wooaRPHZOOdtYFhoCxIcaKAPmzX0VPRQ/+t1w5IjAestHF/q8RTOI1I2WX1Vj6Bumzsm1/XDUbiqigaDz5CbKO7IdmJAPtYUDD4tcw8/8CmzVXTNQnUNU+nwxRdkca7ZZfc4k7zS4/yOAp9MEQk1ugKgWwrQgDh1qmBpk3YnXTv8q1oRvpNIZ2Ut5m9RnUwDIt+ZWusDtIIkie2M+ADIZZDf3yzDvzRP4", "ephemeral": "u7mRyE3BLQjmfSoiYDrhiDTm70oA4egqFJajo9HmgGw", "mac": "UXLXgh8IDzo"}');
...
So is_verified BOOLEAN, but 0 for the value
It break the parsing client side, at least for RiotX (Riot iOS is robust to that mistake)
matrix.org uses postgres and boolean are sent for is_verified, so no problem when using matrix.org
Activity
[-]Int instead of boolean[/-][+]KeyBackup: Int instead of boolean when using sqlite[/+]erikjohnston commentedon Feb 24, 2020
This is because sqlite doesn't really have booleans. We should stick a
bool(...)aroundis_verifiedwhen we pull it out the database.Make code robust to int received instead of boolean
anoadragon453 commentedon Mar 27, 2020
This should be fixed by #6977
richvdh commentedon Mar 27, 2020
#7150 I think