fix: 后台消息查询按字符串返回用户ID

This commit is contained in:
richjohnrambo
2026-09-16 13:24:02 +08:00
parent a01cdae971
commit 1038d25abd
2 changed files with 9 additions and 3 deletions
+6
View File
@@ -75,6 +75,12 @@ func TestMessageQuerySpecsExposeAdminFields(t *testing.T) {
if strings.Contains(strings.ToLower(privateSpec.Select), "m.content as content") || strings.Contains(strings.ToLower(groupSpec.Select), "m.content as content") {
t.Fatal("message list query must not expose full message content")
}
if !strings.Contains(privateSpec.Select, "CAST(m.`from` AS CHAR) AS from_user_id") || !strings.Contains(privateSpec.Select, "CAST(rs.userid AS CHAR) AS to_user_id") {
t.Fatal("private message query must expose 64-bit user IDs as strings")
}
if !strings.Contains(groupSpec.Select, "CAST(m.from_user AS CHAR) AS from_user_id") {
t.Fatal("group message query must expose 64-bit user IDs as strings")
}
}
func TestGroupMessageQuerySupportsOperationalFilters(t *testing.T) {