mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-03 04:42:39 +02:00
fix: critical timestamp parsing and audit fixes
- Fix timestamp conversion: String(epochMs) → new Date(epochMs).toISOString() in use-messages-sync, use-comments-sync, use-documents, use-inbox. Without this, date comparisons (isEdited, cutoff filters) would fail. - Fix updated_at: undefined → null in use-inbox to match InboxItem type - Fix ZeroProvider: skip Zero connection for unauthenticated users - Clean 30+ stale "Electric SQL" comments in backend Python code
This commit is contained in:
parent
f04ab89418
commit
cf21eaacfc
33 changed files with 62 additions and 57 deletions
|
|
@ -203,8 +203,8 @@ export function useCommentsSync(threadId: number | null) {
|
|||
parent_id: c.parentId ?? null,
|
||||
author_id: c.authorId ?? null,
|
||||
content: c.content,
|
||||
created_at: String(c.createdAt),
|
||||
updated_at: String(c.updatedAt),
|
||||
created_at: new Date(c.createdAt).toISOString(),
|
||||
updated_at: new Date(c.updatedAt).toISOString(),
|
||||
}));
|
||||
|
||||
updateReactQueryCache(rows);
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ export function useDocuments(
|
|||
created_by_email: doc.createdById
|
||||
? (emailCacheRef.current.get(doc.createdById) ?? null)
|
||||
: null,
|
||||
created_at: String(doc.createdAt),
|
||||
created_at: new Date(doc.createdAt).toISOString(),
|
||||
status: (doc.status as unknown as DocumentStatusType) ?? { state: "ready" },
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -154,8 +154,8 @@ export function useInbox(
|
|||
message: item.message,
|
||||
read: item.read,
|
||||
metadata: item.metadata as unknown as Record<string, unknown>,
|
||||
created_at: String(item.createdAt),
|
||||
updated_at: item.updatedAt ? String(item.updatedAt) : undefined,
|
||||
created_at: new Date(item.createdAt).toISOString(),
|
||||
updated_at: item.updatedAt ? new Date(item.updatedAt).toISOString() : null,
|
||||
} as InboxItem));
|
||||
|
||||
let updated = prev.map((existing) => {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export function useMessagesSync(
|
|||
role: msg.role,
|
||||
content: msg.content,
|
||||
author_id: msg.authorId ?? null,
|
||||
created_at: String(msg.createdAt),
|
||||
created_at: new Date(msg.createdAt).toISOString(),
|
||||
}));
|
||||
|
||||
onMessagesUpdateRef.current(mapped);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue