[Bug] DM roster: admin-parents don't see their children (exclusive role branches) + avatars generic for ProfileImageId users (#767 follow-up) #770

Closed
opened 2026-07-21 15:55:44 +00:00 by spikerj · 2 comments
Owner

Live-test follow-ups on #767 messaging (2026-07-21):

1. Parent can't see their child in the "new message" roster (child sees parent fine).
Diagnosed: MessagingAccessService.GetRosterAsync branches are EXCLUSIVE — admin/staff callers get only the currently-online list and never reach the parent branch. spikerj is both admin and parent (of toddcan, prod's only minor), so when the child's presence key had lapsed the roster was empty and the child never appeared. Spec says parents ALWAYS see their kids. Fix: make the roster additive — staff/admin online-users ∪ own children (always listed) ∪ (child→parent), deduped with family relationships winning the label. Presence itself verified healthy (both users' messaging-presence:* keys live in Redis).

2. Chat shows generic icons instead of profile pictures.
Both test users have AvatarGridFsId: null but ProfileImageId set — the normal profile-picture flow populates ProfileImageId/Images, while GET api/profile/{userId}/avatar and the messaging DTOs only consult AvatarGridFsId. Fix: GetAvatarQueryHandler falls back AvatarGridFsId ?? ProfileImageId (same GridFS service; images/{imageId} is already AllowAnonymous, so no new exposure), and messaging DTOs use the same coalesce for their has-avatar indicator.

Both fixes backend-only; frontend already renders the image whenever the indicator is non-null.

Live-test follow-ups on #767 messaging (2026-07-21): **1. Parent can't see their child in the "new message" roster (child sees parent fine).** Diagnosed: `MessagingAccessService.GetRosterAsync` branches are EXCLUSIVE — admin/staff callers get only the currently-online list and never reach the parent branch. spikerj is both admin and parent (of toddcan, prod's only minor), so when the child's presence key had lapsed the roster was empty and the child never appeared. Spec says parents ALWAYS see their kids. Fix: make the roster additive — staff/admin online-users ∪ own children (always listed) ∪ (child→parent), deduped with family relationships winning the label. Presence itself verified healthy (both users' `messaging-presence:*` keys live in Redis). **2. Chat shows generic icons instead of profile pictures.** Both test users have `AvatarGridFsId: null` but `ProfileImageId` set — the normal profile-picture flow populates `ProfileImageId`/`Images`, while `GET api/profile/{userId}/avatar` and the messaging DTOs only consult `AvatarGridFsId`. Fix: `GetAvatarQueryHandler` falls back `AvatarGridFsId ?? ProfileImageId` (same GridFS service; `images/{imageId}` is already AllowAnonymous, so no new exposure), and messaging DTOs use the same coalesce for their has-avatar indicator. Both fixes backend-only; frontend already renders the image whenever the indicator is non-null.
Author
Owner

Correction shipped in backend PR #442: the #441 avatar coalesce passed ProfileImageId (a GUID referencing Images[]) straight to storage, which would 500 on ObjectId.Parse for gallery-picture users — GetAvatarImageKey now resolves the entry's real storage key. Roster fix from #441 is unaffected.

Correction shipped in backend PR #442: the #441 avatar coalesce passed ProfileImageId (a GUID referencing Images[]) straight to storage, which would 500 on ObjectId.Parse for gallery-picture users — GetAvatarImageKey now resolves the entry's real storage key. Roster fix from #441 is unaffected.
Author
Owner

Resolved across spikersoft-backend PR #441 (roster additive buckets — merged) and PR #442 (corrected avatar-key resolution — merged + deployed; verified live: both test users' avatars now serve 200 with correct bytes). Closing.

Resolved across spikersoft-backend PR #441 (roster additive buckets — merged) and PR #442 (corrected avatar-key resolution — merged + deployed; verified live: both test users' avatars now serve 200 with correct bytes). Closing.
Sign in to join this conversation.