Ensure chat key fetches bypass cache

Added `{ cache: 'no-store' }` to fetch requests for chat keys in both the chat page and useSodiumChat hook to prevent stale key data. Also updated the chat key query to order by `lastSeenAt` descending, ensuring the most recent bundle is retrieved.
This commit is contained in:
Christopher
2026-01-28 07:48:10 -08:00
parent 28f561f689
commit 558c1aecdf
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -64,7 +64,7 @@ export function useSodiumChat() {
if (!user.did) {
throw new Error('User DID not available');
}
const checkResponse = await fetch(`/api/chat/keys?did=${encodeURIComponent(user.did)}`);
const checkResponse = await fetch(`/api/chat/keys?did=${encodeURIComponent(user.did)}`, { cache: 'no-store' });
let shouldPublish = false;