aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-07-31 14:40:45 +0100
committerGitHub <noreply@github.com>2020-07-31 14:40:45 +0100
commitb5cb1d153458ad83abdfbebed7405dd9da159cb8 (patch)
tree5b5a35ff4805c2f2f071c6c51d095492406db750 /userapi/storage
parenta7e67e65a8662387f1a5ba6860698743f9dbd60f (diff)
Fix edge cases around device lists (#1234)
* Fix New users appear in /keys/changes * Create blank device keys when logging in on a new device * Add PerformDeviceUpdate and fix a few bugs - Correct device deletion query on sqlite - Return no keys on /keys/query rather than an empty key * Unbreak sqlite properly * Use a real DB for currentstateserver integration tests * Race fix
Diffstat (limited to 'userapi/storage')
-rw-r--r--userapi/storage/devices/sqlite3/devices_table.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/userapi/storage/devices/sqlite3/devices_table.go b/userapi/storage/devices/sqlite3/devices_table.go
index efe6f927..9b535aab 100644
--- a/userapi/storage/devices/sqlite3/devices_table.go
+++ b/userapi/storage/devices/sqlite3/devices_table.go
@@ -174,7 +174,7 @@ func (s *devicesStatements) deleteDevice(
func (s *devicesStatements) deleteDevices(
ctx context.Context, txn *sql.Tx, localpart string, devices []string,
) error {
- orig := strings.Replace(deleteDevicesSQL, "($1)", sqlutil.QueryVariadic(len(devices)), 1)
+ orig := strings.Replace(deleteDevicesSQL, "($2)", sqlutil.QueryVariadicOffset(len(devices), 1), 1)
prep, err := s.db.Prepare(orig)
if err != nil {
return err
@@ -186,7 +186,6 @@ func (s *devicesStatements) deleteDevices(
for i, v := range devices {
params[i+1] = v
}
- params = append(params, params...)
_, err = stmt.ExecContext(ctx, params...)
return err
})