Fix profile display backfill startup

This commit is contained in:
richjohnrambo
2026-09-04 16:20:28 +08:00
parent 7fb1ea70bc
commit 50ccdf5f89
3 changed files with 8 additions and 6 deletions
+6 -2
View File
@@ -64,10 +64,14 @@ func TestProfilePublicFromFields(t *testing.T) {
func TestProfileSeedFromPublic(t *testing.T) {
nickname, avatar := profileSeedFromPublic(map[string]any{
"fn": "旧昵称",
"photo": "file_avatar_1",
"fn": "旧昵称",
"avatar_file_id": "file_avatar_1",
})
if nickname != "旧昵称" || avatar != "file_avatar_1" {
t.Fatalf("unexpected profile seed nickname=%q avatar=%q", nickname, avatar)
}
_, avatar = profileSeedFromPublic(map[string]any{"photo": "https://example.com/avatar.png"})
if avatar != "" {
t.Fatalf("photo URL must not be treated as avatar_file_id: %q", avatar)
}
}