From a574ed53696c06e6be6dbe313af0caaa56a659ec Mon Sep 17 00:00:00 2001 From: texuf Date: Tue, 27 Sep 2022 21:19:34 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20for=20`sql:=20converting=20argument=20$1?= =?UTF-8?q?=20type:=20unsupported=20type=20[]interfa=E2=80=A6=20(#2743)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ce {}, a slice of interface` in new notifications select The sqlite3 version was just not working, original pr here: https://github.com/matrix-org/dendrite/pull/2688 signed off by: austin ellis This doesn't fix the notification counts, they still only work about 1 out of every 5 times in my tests. I will stick with my other fix locally for reliable notification delivery: https://github.com/matrix-org/dendrite/pull/2701 --- syncapi/storage/sqlite3/notification_data_table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syncapi/storage/sqlite3/notification_data_table.go b/syncapi/storage/sqlite3/notification_data_table.go index ceff60555..a690ffad6 100644 --- a/syncapi/storage/sqlite3/notification_data_table.go +++ b/syncapi/storage/sqlite3/notification_data_table.go @@ -90,8 +90,8 @@ func (r *notificationDataStatements) SelectUserUnreadCountsForRooms( for i := range roomIDs { params[i+1] = roomIDs[i] } - sql := strings.Replace(selectUserUnreadNotificationsForRooms, "($1)", sqlutil.QueryVariadic(len(params)), 1) - rows, err := r.db.QueryContext(ctx, sql, params) + sql := strings.Replace(selectUserUnreadNotificationsForRooms, "($2)", sqlutil.QueryVariadicOffset(len(roomIDs), 1), 1) + rows, err := r.db.QueryContext(ctx, sql, params...) if err != nil { return nil, err }