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:
@@ -150,7 +150,7 @@ export default function ChatPage() {
|
||||
if (msg.isSentByMe && envelope.recipientDid) {
|
||||
// I'm the sender, so I need the recipient's public key to decrypt my own message
|
||||
try {
|
||||
const keyRes = await fetch(`/api/chat/keys?did=${encodeURIComponent(envelope.recipientDid)}`);
|
||||
const keyRes = await fetch(`/api/chat/keys?did=${encodeURIComponent(envelope.recipientDid)}`, { cache: 'no-store' });
|
||||
if (keyRes.ok) {
|
||||
const keyData = await keyRes.json();
|
||||
otherPartyPublicKey = keyData.publicKey;
|
||||
|
||||
Reference in New Issue
Block a user