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:
@@ -21,6 +21,7 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
const bundle = await db.query.chatDeviceBundles.findFirst({
|
||||
where: eq(chatDeviceBundles.did, did),
|
||||
orderBy: (bundles, { desc }) => [desc(bundles.lastSeenAt)],
|
||||
});
|
||||
|
||||
console.log('[Chat Keys GET] Found local bundle:', bundle ? 'YES' : 'NO');
|
||||
|
||||
Reference in New Issue
Block a user