Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: mark adjusted backup timestamps as estimated (#12322)

Michael Han75d8bdafc380
diff --git a/studio/frontend/src/features/chat/utils/studio-backup-import.ts b/studio/frontend/src/features/chat/utils/studio-backup-import.ts
index 58e3d9ed6cf..de38284a83a 100644
--- a/studio/frontend/src/features/chat/utils/studio-backup-import.ts
+++ b/studio/frontend/src/features/chat/utils/studio-backup-import.ts
@@ -206,7 +206,8 @@ export function studioBackupToConversations(
record.attachments = raw.attachments as MessageRecord["attachments"];
}
if (isDict(raw.metadata)) record.metadata = detachMetadata(raw.metadata);
- if (num(raw.createdAt) === null) {
+ // Ordering adjustments are not exact send times.
+ if (num(raw.createdAt) === null || ts !== createdAt) {
record.metadata = { ...record.metadata, createdAtEstimated: true };
}
return record;
diff --git a/studio/frontend/tests/studio-backup-import.test.ts b/studio/frontend/tests/studio-backup-import.test.ts
index d2fad30e157..7c4f88221b3 100644
--- a/studio/frontend/tests/studio-backup-import.test.ts
+++ b/studio/frontend/tests/studio-backup-import.test.ts
@@ -272,7 +272,7 @@ test("a compare pair stays paired under a new pair id, and legacy rows without p
],
messages: [
{ id: "a1", threadId: "a", role: "user", content: [{ type: "text", text: "hi" }], createdAt: 5 },
- { id: "a2", threadId: "a", role: "assistant", content: [{ type: "text", text: "yo" }], createdAt: 5 },
+ { id: "a2", threadId: "a", role: "assistant", content: [{ type: "text", text: "yo" }], createdAt: 5, metadata: { note: "kept", createdAtEstimated: false } },
{ id: "b1", threadId: "b", role: "user", content: [{ type: "text", text: "hi" }], createdAt: 5 },
{ id: "orphan", threadId: "gone", role: "user", content: [{ type: "text", text: "lost" }], createdAt: 5 },
],
@@ -286,6 +286,8 @@ test("a compare pair stays paired under a new pair id, and legacy rows without p
const left = messages.get(threads.find(({ title }) => title === "Left")?.id ?? "") as MessageRecord[];
assert.deepEqual(left.map(({ role }) => role), ["user", "assistant"]);
assert.deepEqual(left.map(({ createdAt }) => createdAt), [5, 6]);
+ assert.notEqual(left[0].metadata?.createdAtEstimated, true);
+ assert.deepEqual(left[1].metadata, { note: "kept", createdAtEstimated: true });
assert.ok(left.every((record) => !("parentId" in record)));
});