From 8dc9498eb83f503edb6bdc18f7f640b80ad80153 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 17 Aug 2026 23:26:24 -0700 Subject: A full profile fetch outranks the day-old cache: the freshest kind 0 stamps the light cache and repaints the header, so a face changed elsewhere shows up in seconds instead of after the TTL Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz --- src/features/messages.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/features/messages.js b/src/features/messages.js index f5e647b..a89854a 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -1100,8 +1100,15 @@ export function messagesFeature(ctx) { try { m = newest ? JSON.parse(newest.content) : {}; } catch {} fullProfiles.set(pk, m); persistPage('full', pk, m); - profiles.set(pk, { name: m.display_name || m.name || null, picture: m.picture || null }); + // A full fetch is the freshest word on this profile — stamp it into the + // light cache (and persist) so a picture changed elsewhere replaces the + // stale one everywhere within a session, not after the 24h TTL. The + // repaint covers the header/chat avatars, not just an open profile page. + const entry = { name: m.display_name || m.name || null, picture: m.picture || null, t: Date.now() }; + profiles.set(pk, entry); + persistProfile(pk, entry); if (ui.profilePk === pk) render(); + else scheduleRepaint(); }).catch(() => { if (!fullProfiles.has(pk)) fullProfiles.set(pk, {}); }); } -- cgit v1.2.3