feat(iios): expose senderId (stable externalId) on MessageDto
The app needs a reliable "is this message mine?" signal. senderActorId worked only with a lazily-learned actorId, which Supabase token-refresh wipes. senderId is the sender's externalId (email/username) — always present and comparable to the session user — so message alignment is deterministic. Verified: senderId round-trips = email. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ export interface MessageDto {
|
|||||||
id: string;
|
id: string;
|
||||||
threadId: string;
|
threadId: string;
|
||||||
senderActorId: string;
|
senderActorId: string;
|
||||||
|
senderId: string; // the sender's stable externalId (email/username) — reliable "is this mine?"
|
||||||
senderName: string;
|
senderName: string;
|
||||||
content: string;
|
content: string;
|
||||||
contentRef?: string;
|
contentRef?: string;
|
||||||
@@ -506,6 +507,7 @@ export class MessageService {
|
|||||||
id: interaction.id,
|
id: interaction.id,
|
||||||
threadId,
|
threadId,
|
||||||
senderActorId: interaction.actorId ?? '',
|
senderActorId: interaction.actorId ?? '',
|
||||||
|
senderId: interaction.actor?.sourceHandle?.externalId ?? '',
|
||||||
senderName: interaction.actor?.displayName ?? interaction.actor?.sourceHandle?.externalId ?? 'unknown',
|
senderName: interaction.actor?.displayName ?? interaction.actor?.sourceHandle?.externalId ?? 'unknown',
|
||||||
content: text?.bodyText ?? '',
|
content: text?.bodyText ?? '',
|
||||||
contentRef: file?.contentRef ?? undefined,
|
contentRef: file?.contentRef ?? undefined,
|
||||||
|
|||||||
Reference in New Issue
Block a user