From d5a4cfb112f8b619fbb36109ee4f64b69346cd95 Mon Sep 17 00:00:00 2001 From: Winter Date: Sat, 9 Aug 2025 22:02:31 -0400 Subject: [PATCH] appview/db: fix comparing against []byte Change-Id: xqqzsrpkuoqzrmmlzlsmnrpknxpnxqrz SQLite stores byte sequences as blobs, which we were not handling properly, causing (at least) actions relating to artifacts to break. (Not sure when they broke, sorry!) Signed-off-by: Winter --- appview/db/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appview/db/db.go b/appview/db/db.go index e18646d..e3b3d6e 100644 --- a/appview/db/db.go +++ b/appview/db/db.go @@ -728,7 +728,7 @@ func (f filter) Condition() string { kind := rv.Kind() // if we have `FilterIn(k, [1, 2, 3])`, compile it down to `k in (?, ?, ?)` - if kind == reflect.Slice || kind == reflect.Array { + if (kind == reflect.Slice && rv.Type().Elem().Kind() != reflect.Uint8) || kind == reflect.Array { if rv.Len() == 0 { // always false return "1 = 0" @@ -748,7 +748,7 @@ func (f filter) Condition() string { func (f filter) Arg() []any { rv := reflect.ValueOf(f.arg) kind := rv.Kind() - if kind == reflect.Slice || kind == reflect.Array { + if (kind == reflect.Slice && rv.Type().Elem().Kind() != reflect.Uint8) || kind == reflect.Array { if rv.Len() == 0 { return nil } -- 2.43.0