fix: avoid stale profile projections in shared schema

This commit is contained in:
richjohnrambo
2026-09-23 10:28:15 +08:00
parent 7f0903cd31
commit 6303d07580
3 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -6773,7 +6773,7 @@ func (a *adapter) TenantFriendshipList(id t.TenantID, uid t.Uid, queryText, init
if cancel != nil {
defer cancel()
}
rows, err := a.db.QueryxContext(ctx, fmt.Sprintf(`SELECT fs.*,u.trusted,
rows, err := a.db.QueryxContext(ctx, fmt.Sprintf(`SELECT fs.id,fs.user_id,fs.peer_id,fs.status,fs.remark,fs.topic,fs.created_at,fs.updated_at,u.trusted,
p.nickname AS profile_nickname,p.avatar_file_id AS profile_avatar_file_id,p.signature AS profile_signature,
p.gender AS profile_gender,p.region AS profile_region,p.public_account AS profile_public_account,p.updated_at AS profile_updated_at
FROM %s AS fs
+2
View File
@@ -4252,6 +4252,8 @@ func serveIMGroupMembers(wrt http.ResponseWriter, req *http.Request, topic strin
Mentionable: mentionableOnly,
})
if err != nil {
logs.Warn.Printf("im http: list group members failed tenant=%d topic=%s uid=%s limit=%d cursor=%q query=%q role=%q mentionable=%t err=%v",
principal.TenantID, topic, principal.Uid.UserId(), limit, cursor, query, roleFilter, mentionableOnly, err)
writeIMError(wrt, req, http.StatusInternalServerError, 90000, imReasonInternal, "internal error", nil)
return
}
-3
View File
@@ -2722,9 +2722,6 @@ func refreshUserProfileProjections(tenantID types.TenantID, uid types.Uid, profi
if types.GetTopicCat(sub.Topic) != types.TopicCatGrp {
continue
}
if err := Subs.Update(tenantID, sub.Topic, uid, map[string]any{"Public": public}); err != nil {
logs.Warn.Printf("profile %s: refresh group subscription %s public failed: %v", uid, sub.Topic, err)
}
invalidateGroupMemberPages(tenantID, sub.Topic)
}
}