Fix for `sql: converting argument $1 type: unsupported type []interfa… (#2743)

…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 <austin@hntlabs.com>

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
This commit is contained in:
texuf 2022-09-27 21:19:34 -07:00 committed by GitHub
parent 083ae01520
commit a574ed5369
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -90,8 +90,8 @@ func (r *notificationDataStatements) SelectUserUnreadCountsForRooms(
for i := range roomIDs { for i := range roomIDs {
params[i+1] = roomIDs[i] params[i+1] = roomIDs[i]
} }
sql := strings.Replace(selectUserUnreadNotificationsForRooms, "($1)", sqlutil.QueryVariadic(len(params)), 1) sql := strings.Replace(selectUserUnreadNotificationsForRooms, "($2)", sqlutil.QueryVariadicOffset(len(roomIDs), 1), 1)
rows, err := r.db.QueryContext(ctx, sql, params) rows, err := r.db.QueryContext(ctx, sql, params...)
if err != nil { if err != nil {
return nil, err return nil, err
} }