feat: synchronize account icons across game profiles

This commit is contained in:
2026-07-31 11:21:08 +00:00
parent c8adeeb47b
commit 5f20413552
87 changed files with 5755 additions and 280 deletions
+4 -2
View File
@@ -2,10 +2,11 @@ export interface GatewayUserFlushEvent {
userId: string;
flushedAt: string;
reason?: string;
iconRevision?: string;
}
export interface GatewayFlushPublisher {
publishUserFlush(userId: string, reason?: string): Promise<void>;
publishUserFlush(userId: string, reason?: string, metadata?: { iconRevision?: string }): Promise<void>;
}
export class RedisGatewayFlushPublisher implements GatewayFlushPublisher {
@@ -17,11 +18,12 @@ export class RedisGatewayFlushPublisher implements GatewayFlushPublisher {
this.channel = channel;
}
async publishUserFlush(userId: string, reason?: string): Promise<void> {
async publishUserFlush(userId: string, reason?: string, metadata?: { iconRevision?: string }): Promise<void> {
const payload: GatewayUserFlushEvent = {
userId,
flushedAt: new Date().toISOString(),
reason,
...(metadata?.iconRevision ? { iconRevision: metadata.iconRevision } : {}),
};
await this.client.publish(this.channel, JSON.stringify(payload));
}