Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(web-app): retry failed message writes and give a stuck close an explicit way out

Akarshan Biswas2a5aaa6920c8
diff --git a/web-app/src/hooks/__tests__/useMessages.persistence.test.ts b/web-app/src/hooks/__tests__/useMessages.persistence.test.ts
new file mode 100644
index 000000000..b6e0e8f6a
--- /dev/null
+++ b/web-app/src/hooks/__tests__/useMessages.persistence.test.ts
@@ -0,0 +1,113 @@
+import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
+import type { ThreadMessage } from '@janhq/core'
+
+const service = vi.hoisted(() => ({
+ createMessage: vi.fn(),
+ modifyMessage: vi.fn(),
+ deleteMessage: vi.fn(),
+}))
+vi.mock('@/hooks/useServiceHub', () => ({
+ getServiceHub: () => ({ messages: () => service }),
+}))
+const sonner = vi.hoisted(() => ({ error: vi.fn(), dismiss: vi.fn() }))
+vi.mock('sonner', () => ({ toast: sonner }))
+vi.mock('@/i18n/react-i18next-compat', () => ({
+ i18n: { t: (key: string) => key },
+}))
+
+import {
+ useMessages,
+ flushMessageWrites,
+ forgetMessageWrites,
+ __resetMessageWritesForTests,
+} from '../useMessages'
+
+const message = (id: string, threadId = 't1') =>
+ ({ id, thread_id: threadId, role: 'user', content: 'x', created_at: 1 }) as unknown as ThreadMessage
+
+describe('useMessages write persistence', () => {
+ beforeEach(() => {
+ vi.useFakeTimers()
+ __resetMessageWritesForTests()
+ vi.clearAllMocks()
+ useMessages.setState({ messages: {} })
+ vi.spyOn(console, 'error').mockImplementation(() => undefined)
+ })
+ afterEach(() => {
+ vi.useRealTimers()
+ vi.restoreAllMocks()
+ })
+
+ it('retries a failed head with backoff, in order, and clears the toast on recovery', async () => {
+ const written: string[] = []
+ let failures = 2
+ service.createMessage.mockImplementation(async (m: { id: string }) => {
+ if (m.id === 'a' && failures-- > 0) throw new Error('disk full')
+ written.push(m.id)
+ })
+ useMessages.getState().addMessage(message('a'))
+ useMessages.getState().addMessage(message('b'))
+ await vi.advanceTimersByTimeAsync(0)
+ expect(written).toEqual([])
+ expect(sonner.error).toHaveBeenCalledWith(
+ 'common:messageWrites.failedTitle',
+ expect.objectContaining({ id: 'message-writes-failed' })
+ )
+
+ await vi.runAllTimersAsync()
+ expect(written).toEqual(['a', 'b'])
+ expect(sonner.dismiss).toHaveBeenCalledWith('message-writes-failed')
+ })
+
+ it('stops the timer after the bounded attempts and retries on the next enqueue', async () => {
+ let healthy = false
+ const written: string[] = []
+ service.createMessage.mockImplementation(async (m: { id: string }) => {
+ if (!healthy) throw new Error('io')
+ written.push(m.id)
+ })
+ useMessages.getState().addMessage(message('a'))
+ await vi.advanceTimersByTimeAsync(0)
+ // runAllTimersAsync aborts on an endless timer chain, so this also proves the bound.
+ await vi.runAllTimersAsync()
+ const attempts = service.createMessage.mock.calls.length
+ expect(attempts).toBeGreaterThan(1)
+ await vi.advanceTimersByTimeAsync(10 * 60_000)
+ expect(service.createMessage).toHaveBeenCalledTimes(attempts)
+
+ healthy = true
+ useMessages.getState().addMessage(message('b'))
+ await vi.advanceTimersByTimeAsync(0)
+ expect(written).toEqual(['a', 'b'])
+ expect(sonner.dismiss).toHaveBeenCalledWith('message-writes-failed')
+ })
+
+ it('keeps the toast while another thread is still failing', async () => {
+ service.createMessage.mockImplementation(async (m: { thread_id: string }) => {
+ if (m.thread_id === 'bad') throw new Error('io')
+ })
+ useMessages.getState().addMessage(message('a', 'bad'))
+ useMessages.getState().addMessage(message('b', 'good'))
+ await vi.advanceTimersByTimeAsync(0)
+ expect(sonner.dismiss).not.toHaveBeenCalled()
+ })
+
+ it('still rejects an explicit flush for a persistent failure', async () => {
+ service.createMessage.mockRejectedValue(new Error('io'))
+ useMessages.getState().addMessage(message('a'))
+ await expect(flushMessageWrites()).rejects.toThrow('io')
+ })
+
+ it('drops a deleted thread queue, its pending jobs, its timer and its toast', async () => {
+ service.createMessage.mockRejectedValue(new Error('io'))
+ useMessages.getState().addMessage(message('a'))
+ await vi.advanceTimersByTimeAsync(0)
+ const attempts = service.createMessage.mock.calls.length
+
+ forgetMessageWrites('t1')
+ expect(sonner.dismiss).toHaveBeenCalledWith('message-writes-failed')
+ await vi.advanceTimersByTimeAsync(60_000)
+ expect(service.createMessage).toHaveBeenCalledTimes(attempts)
+ await expect(flushMessageWrites()).resolves.toBeUndefined()
+ })
+})
diff --git a/web-app/src/hooks/__tests__/useThreads.test.ts b/web-app/src/hooks/__tests__/useThreads.test.ts
index 12caa5b59..c70c1b00d 100644
--- a/web-app/src/hooks/__tests__/useThreads.test.ts
+++ b/web-app/src/hooks/__tests__/useThreads.test.ts
@@ -1,6 +1,9 @@
import { describe, it, expect, beforeEach, vi } from 'vitest'
import { act, renderHook } from '@testing-library/react'
import { useThreads } from '../useThreads'
+import { forgetMessageWrites } from '../useMessages'
+
+vi.mock('../useMessages', () => ({ forgetMessageWrites: vi.fn() }))
// Mock the services
vi.mock('@/services/threads', () => ({
@@ -159,6 +162,17 @@ describe('useThreads', () => {
expect(result.current.threads['thread2']).toBeDefined()
})
+ it('drops the deleted thread message write queue', () => {
+ const { result } = renderHook(() => useThreads())
+ act(() => {
+ result.current.setThreads([{ id: 'thread1', title: 'Thread 1', messages: [] }])
+ })
+ act(() => {
+ result.current.deleteThread('thread1')
+ })
+ expect(forgetMessageWrites).toHaveBeenCalledWith('thread1')
+ })
+
it('should rename thread', () => {
const { result } = renderHook(() => useThreads())
diff --git a/web-app/src/hooks/useMessages.ts b/web-app/src/hooks/useMessages.ts
index 96a69ad09..a9667baae 100644
--- a/web-app/src/hooks/useMessages.ts
+++ b/web-app/src/hooks/useMessages.ts
@@ -1,5 +1,7 @@
import { create } from 'zustand'
import { ThreadMessage } from '@janhq/core'
+import { toast } from 'sonner'
+import { i18n } from '@/i18n/react-i18next-compat'
import { getServiceHub } from '@/hooks/useServiceHub'
type MessageState = {
@@ -12,25 +14,101 @@ type MessageState = {
clearAllMessages: () => void
}
-// A failed head stays queued. Later edits/deletes must never overtake it.
-type WriteQueue = { jobs: Array<() => Promise<unknown>>; running?: Promise<void>; error?: unknown }
+/**
+ * Per-thread write queue. A failed head stays queued: later edits/deletes must
+ * never overtake it, or a stale write could land after a newer one.
+ *
+ * A failed head is retried on its own (bounded backoff, then it stops so a
+ * dead disk does not spin forever), on every later enqueue, on the toast's
+ * Retry action and on the window-close flush. While any queue is failing the
+ * user sees a persistent toast, because the UI otherwise shows the message as
+ * saved. Failure never drops a write: data loss is worse than a stalled queue.
+ */
+type WriteQueue = {
+ jobs: Array<() => Promise<unknown>>
+ running?: Promise<void>
+ failing: boolean
+ retries: number
+ retryTimer?: ReturnType<typeof setTimeout>
+ dropped: boolean
+}
+
+/** Delay before each automatic retry of a failed head; its length bounds them. */
+const MESSAGE_WRITE_RETRY_DELAYS_MS = [1_000, 5_000, 15_000, 60_000]
+const WRITE_FAILED_TOAST_ID = 'message-writes-failed'
const writes = new Map<string, WriteQueue>()
+
+const noop = () => {}
+
+function retryNow(queue: WriteQueue) {
+ queue.retries = 0
+ void drain(queue).catch(noop)
+}
+
+function dismissToastIfHealthy() {
+ if (![...writes.values()].some((queue) => queue.failing)) toast.dismiss(WRITE_FAILED_TOAST_ID)
+}
+
+function onWriteFailed(queue: WriteQueue, error: unknown) {
+ console.error('Failed to persist message:', error)
+ if (queue.dropped) return
+ queue.failing = true
+ toast.error(i18n.t('common:messageWrites.failedTitle'), {
+ id: WRITE_FAILED_TOAST_ID,
+ description: i18n.t('common:messageWrites.failedDescription'),
+ duration: Infinity,
+ action: {
+ label: i18n.t('common:messageWrites.retry'),
+ onClick: () => writes.forEach((q) => q.failing && retryNow(q)),
+ },
+ })
+ const delay = MESSAGE_WRITE_RETRY_DELAYS_MS[queue.retries]
+ if (delay === undefined) return
+ queue.retries += 1
+ queue.retryTimer = setTimeout(() => void drain(queue).catch(noop), delay)
+}
+
function drain(queue: WriteQueue): Promise<void> {
if (queue.running) return queue.running
+ clearTimeout(queue.retryTimer)
+ queue.retryTimer = undefined
queue.running = (async () => {
while (queue.jobs.length) {
- try { await queue.jobs[0](); queue.jobs.shift(); queue.error = undefined }
- catch (error) { queue.error = error; throw error }
+ try {
+ await queue.jobs[0]()
+ } catch (error) {
+ onWriteFailed(queue, error)
+ throw error
+ }
+ queue.jobs.shift()
+ if (queue.failing) {
+ queue.failing = false
+ dismissToastIfHealthy()
+ }
}
})().finally(() => { queue.running = undefined })
- void queue.running.catch(() => {})
+ void queue.running.catch(noop)
return queue.running
}
function enqueue(threadId: string, job: () => Promise<unknown>) {
- const queue = writes.get(threadId) ?? { jobs: [] }
+ const queue = writes.get(threadId) ?? { jobs: [], failing: false, retries: 0, dropped: false }
writes.set(threadId, queue)
queue.jobs.push(job)
- if (!queue.error) void drain(queue).catch((error) => console.error('Failed to persist message:', error))
+ retryNow(queue)
+}
+
+/**
+ * Drop a deleted thread's queue: its pending writes target a thread that no
+ * longer exists, and the map would otherwise keep an entry per thread forever.
+ */
+export function forgetMessageWrites(threadId: string): void {
+ const queue = writes.get(threadId)
+ if (!queue) return
+ queue.dropped = true
+ queue.jobs.length = 0
+ clearTimeout(queue.retryTimer)
+ writes.delete(threadId)
+ if (queue.failing) dismissToastIfHealthy()
}
/**
* Explicit close retry: drain FIRST, retrying failed heads in order, and throw
@@ -43,7 +121,10 @@ export async function flushMessageWrites(): Promise<void> {
if (failed?.status === 'rejected') throw failed.reason
if ([...writes.values()].some((queue) => queue.jobs.length || queue.running)) await flushMessageWrites()
}
-export function __resetMessageWritesForTests() { writes.clear() }
+export function __resetMessageWritesForTests() {
+ writes.forEach((queue) => clearTimeout(queue.retryTimer))
+ writes.clear()
+}
export const useMessages = create<MessageState>()((set, get) => ({
messages: {},
diff --git a/web-app/src/hooks/useThreads.ts b/web-app/src/hooks/useThreads.ts
index dcc603a33..1eff67ea9 100644
--- a/web-app/src/hooks/useThreads.ts
+++ b/web-app/src/hooks/useThreads.ts
@@ -10,6 +10,7 @@ import { useChatSessions } from '@/stores/chat-session-store'
import { useAppState } from '@/hooks/useAppState'
import { cleanupThreadWorkspace } from '@/lib/agentTools'
import { isCoworkThread } from '@/lib/threadMode'
+import { forgetMessageWrites } from '@/hooks/useMessages'
import {
deleteCoworkConversation,
hasCoworkSession,
@@ -124,6 +125,7 @@ export const isDeletedByDeleteAll = (thread: Thread): boolean =>
* service.
*/
const deleteThreadEverywhere = (threadId: string, thread: Thread | undefined) => {
+ forgetMessageWrites(threadId)
if (isCoworkThread(thread) && hasCoworkSession(threadId)) {
deleteCoworkConversation(threadId)
return
diff --git a/web-app/src/lib/__tests__/coworkSync.test.ts b/web-app/src/lib/__tests__/coworkSync.test.ts
index 01eabeb9f..54576aa71 100644
--- a/web-app/src/lib/__tests__/coworkSync.test.ts
+++ b/web-app/src/lib/__tests__/coworkSync.test.ts
@@ -96,9 +96,11 @@ vi.mock('@/i18n/react-i18next-compat', () => ({
}))
const closeWindow = vi.hoisted(() => ({
callback: null as null | ((event: { preventDefault: () => void }) => Promise<void>),
+ destroy: vi.fn(async () => {}),
}))
vi.mock('@tauri-apps/api/window', () => ({
getCurrentWindow: () => ({
+ destroy: closeWindow.destroy,
onCloseRequested: vi.fn(async (callback) => {
closeWindow.callback = callback
return () => {}
@@ -117,6 +119,7 @@ import {
flushCoworkStartupWarnings,
isCoworkMigrationDone,
COWORK_MIGRATION_BUDGET_MS,
+ COWORK_CLOSE_FAILURES_BEFORE_FORCE,
__resetCoworkSyncForTests,
} from '../coworkSync'
import {
@@ -157,6 +160,8 @@ describe('coworkSync', () => {
sonner.dismiss.mockClear()
platform.tauri = true
closeWindow.callback = null
+ closeWindow.destroy.mockClear()
+ sonner.error.mockClear()
messageStore.create = async (message) => message
__resetMessageWritesForTests()
__resetCoworkSyncForTests()
@@ -531,6 +536,52 @@ describe('coworkSync', () => {
expect(written).toEqual(['chat-1', 'chat-2'])
})
+ it('offers an explicit close-without-saving after repeated failed closes, never silently', async () => {
+ await startCoworkSync()
+ messageStore.create = async () => {
+ throw new Error('disk full')
+ }
+ useMessages.getState().addMessage({ id: 'chat-x', thread_id: 't-stuck' } as any)
+ const errorOptions = () => sonner.error.mock.calls.map((call) => call[1])
+ for (let attempt = 1; attempt <= COWORK_CLOSE_FAILURES_BEFORE_FORCE; attempt += 1) {
+ const event = closeEvent()
+ await closeWindow.callback!(event)
+ expect(event.preventDefault).toHaveBeenCalled()
+ expect(sonner.error).toHaveBeenLastCalledWith(
+ 'common:coworkSync.closeFailedTitle',
+ expect.objectContaining({ id: 'cowork-close-failed' })
+ )
+ const action = errorOptions().at(-1)?.action
+ if (attempt < COWORK_CLOSE_FAILURES_BEFORE_FORCE) expect(action).toBeUndefined()
+ else expect(action).toEqual(expect.objectContaining({ label: 'common:coworkSync.closeAnyway' }))
+ }
+ expect(closeWindow.destroy).not.toHaveBeenCalled()
+ errorOptions().at(-1).action.onClick()
+ expect(closeWindow.destroy).toHaveBeenCalledTimes(1)
+ })
+
+ it('a successful close attempt resets the failure count and dismisses the close toast', async () => {
+ await startCoworkSync()
+ let failing = true
+ messageStore.create = async (message) => {
+ if (failing) throw new Error('disk full')
+ return message
+ }
+ useMessages.getState().addMessage({ id: 'chat-y', thread_id: 't-stuck' } as any)
+ for (let attempt = 1; attempt < COWORK_CLOSE_FAILURES_BEFORE_FORCE; attempt += 1) {
+ await closeWindow.callback!(closeEvent())
+ }
+ failing = false
+ const ok = closeEvent()
+ await closeWindow.callback!(ok)
+ expect(ok.preventDefault).not.toHaveBeenCalled()
+ expect(sonner.dismiss).toHaveBeenCalledWith('cowork-close-failed')
+ failing = true
+ useMessages.getState().addMessage({ id: 'chat-z', thread_id: 't-stuck' } as any)
+ await closeWindow.callback!(closeEvent())
+ expect(sonner.error.mock.calls.at(-1)?.[1].action).toBeUndefined()
+ })
+
it('a failing derived messages mirror never traps the window open', async () => {
await startCoworkSync()
const id = useCoworkSessions.getState().createSession()
diff --git a/web-app/src/lib/coworkSync.ts b/web-app/src/lib/coworkSync.ts
index 72977a133..994774209 100644
--- a/web-app/src/lib/coworkSync.ts
+++ b/web-app/src/lib/coworkSync.ts
@@ -69,6 +69,14 @@ const pendingDeletes = new Set<Promise<void>>()
let deleteFailure: unknown = null
let pendingStartupWarning: (() => void) | null = null
let closeListenersInstalled = false
+let closeFailures = 0
+const CLOSE_FAILED_TOAST_ID = 'cowork-close-failed'
+
+/**
+ * Consecutive failed close attempts (a storage error or the 10 s deadline)
+ * after which the failure toast offers to close without saving.
+ */
+export const COWORK_CLOSE_FAILURES_BEFORE_FORCE = 3
/**
* Re-raise startup warnings once a sonner `<Toaster>` is mounted. Sonner drops
@@ -452,7 +460,8 @@ async function installCloseHandlers() {
})
try {
const { getCurrentWindow } = await import('@tauri-apps/api/window')
- await getCurrentWindow().onCloseRequested(async (event) => {
+ const appWindow = getCurrentWindow()
+ await appWindow.onCloseRequested(async (event) => {
// Awaiting here holds the close until every queued and in-flight write
// has settled. On failure keep the window (and the unsaved state) alive;
// another close request retries storage rather than losing the run.
@@ -469,11 +478,38 @@ async function installCloseHandlers() {
if (failed?.status === 'rejected') throw failed.reason
})()
)
+ closeFailures = 0
+ toast.dismiss(CLOSE_FAILED_TOAST_ID)
} catch (e) {
event.preventDefault()
resumeCoworkAfterPreventedClose()
resumeChatsAfterPreventedClose()
console.warn('[cowork] flush on close failed:', e)
+ closeFailures += 1
+ // Keeping the window is the default (data loss is worse than a stuck
+ // window), but the user must always see why it did not close, and after
+ // repeated failures get an explicit way out that names the cost.
+ const canForce = closeFailures >= COWORK_CLOSE_FAILURES_BEFORE_FORCE
+ toast.error(i18n.t('common:coworkSync.closeFailedTitle'), {
+ id: CLOSE_FAILED_TOAST_ID,
+ duration: Infinity,
+ description: i18n.t(
+ canForce
+ ? 'common:coworkSync.closeForceDescription'
+ : 'common:coworkSync.closeFailedDescription'
+ ),
+ action: canForce
+ ? {
+ label: i18n.t('common:coworkSync.closeAnyway'),
+ // destroy() skips the close-requested event that would block it.
+ onClick: () => {
+ void appWindow.destroy().catch((error) => {
+ console.warn('[cowork] could not close the window:', error)
+ })
+ },
+ }
+ : undefined,
+ })
}
})
} catch (e) {
@@ -493,4 +529,5 @@ export function __resetCoworkSyncForTests() {
deleteFailure = null
pendingStartupWarning = null
closeListenersInstalled = false
+ closeFailures = 0
}
diff --git a/web-app/src/locales/de-DE/common.json b/web-app/src/locales/de-DE/common.json
index 657de03a2..d50bb690a 100644
--- a/web-app/src/locales/de-DE/common.json
+++ b/web-app/src/locales/de-DE/common.json
@@ -421,7 +421,16 @@
"missingThreadTitle": "Eine Cowork-Unterhaltung konnte nicht gespeichert werden",
"missingThreadDescription": "Der gespeicherte Thread fehlt, daher werden Änderungen nicht mehr gespeichert. Sie können ihn weiterhin lesen, exportieren oder löschen.",
"writeRefusedTitle": "Eine Cowork-Unterhaltung kann nicht gespeichert werden",
- "writeRefusedDescription": "Jan kann diese Unterhaltung nicht unter ihrer aktuellen ID speichern, daher werden Änderungen nicht gespeichert. Sie können sie weiterhin lesen, exportieren oder löschen."
+ "writeRefusedDescription": "Jan kann diese Unterhaltung nicht unter ihrer aktuellen ID speichern, daher werden Änderungen nicht gespeichert. Sie können sie weiterhin lesen, exportieren oder löschen.",
+ "closeFailedTitle": "Jan konnte nicht alles speichern und bleibt daher geöffnet",
+ "closeFailedDescription": "Ihre letzten Änderungen befinden sich noch im Arbeitsspeicher. Schließen Sie das Fenster erneut, um das Speichern zu wiederholen.",
+ "closeForceDescription": "Das Speichern schlägt weiterhin fehl. Sie können ohne Speichern schließen; dabei gehen die Änderungen verloren, die nicht geschrieben werden konnten.",
+ "closeAnyway": "Ohne Speichern schließen"
+ },
+ "messageWrites": {
+ "failedTitle": "Einige Nachrichten konnten nicht gespeichert werden",
+ "failedDescription": "Jan versucht es weiter. Bis es gelingt, existieren die letzten Nachrichten nur in diesem Fenster.",
+ "retry": "Jetzt erneut versuchen"
},
"threadRoute": {
"notReadyTitle": "Diese Unterhaltung ist noch nicht bereit",
diff --git a/web-app/src/locales/en/common.json b/web-app/src/locales/en/common.json
index 640584c97..c670ca411 100644
--- a/web-app/src/locales/en/common.json
+++ b/web-app/src/locales/en/common.json
@@ -805,7 +805,16 @@
"missingThreadTitle": "A Cowork conversation could not be saved",
"missingThreadDescription": "Its stored thread is missing, so changes are no longer saved. You can still read, export or delete it.",
"writeRefusedTitle": "A Cowork conversation cannot be saved",
- "writeRefusedDescription": "Jan cannot store this conversation under its current id, so changes are not saved. You can still read, export or delete it."
+ "writeRefusedDescription": "Jan cannot store this conversation under its current id, so changes are not saved. You can still read, export or delete it.",
+ "closeFailedTitle": "Jan could not save everything, so it stayed open",
+ "closeFailedDescription": "Your latest changes are still in memory. Close the window again to retry saving.",
+ "closeForceDescription": "Saving keeps failing. You can close without saving, which loses the changes that could not be written.",
+ "closeAnyway": "Close without saving"
+ },
+ "messageWrites": {
+ "failedTitle": "Some messages could not be saved",
+ "failedDescription": "Jan keeps retrying. Until it succeeds, recent messages exist only in this window.",
+ "retry": "Retry now"
},
"threadRoute": {
"notReadyTitle": "This conversation isn't ready yet",
diff --git a/web-app/src/locales/fr/common.json b/web-app/src/locales/fr/common.json
index 2ed2728bb..3c26a8d8e 100644
--- a/web-app/src/locales/fr/common.json
+++ b/web-app/src/locales/fr/common.json
@@ -424,7 +424,16 @@
"missingThreadTitle": "Une conversation Cowork n'a pas pu être enregistrée",
"missingThreadDescription": "Son fil enregistré est introuvable, les modifications ne sont donc plus enregistrées. Vous pouvez toujours le lire, l'exporter ou le supprimer.",
"writeRefusedTitle": "Une conversation Cowork ne peut pas être enregistrée",
- "writeRefusedDescription": "Jan ne peut pas enregistrer cette conversation sous son identifiant actuel, les modifications ne sont donc pas enregistrées. Vous pouvez toujours la lire, l'exporter ou la supprimer."
+ "writeRefusedDescription": "Jan ne peut pas enregistrer cette conversation sous son identifiant actuel, les modifications ne sont donc pas enregistrées. Vous pouvez toujours la lire, l'exporter ou la supprimer.",
+ "closeFailedTitle": "Jan n'a pas pu tout enregistrer et est resté ouvert",
+ "closeFailedDescription": "Vos dernières modifications sont encore en mémoire. Fermez à nouveau la fenêtre pour réessayer l'enregistrement.",
+ "closeForceDescription": "L'enregistrement échoue toujours. Vous pouvez fermer sans enregistrer, ce qui perd les modifications qui n'ont pas pu être écrites.",
+ "closeAnyway": "Fermer sans enregistrer"
+ },
+ "messageWrites": {
+ "failedTitle": "Certains messages n'ont pas pu être enregistrés",
+ "failedDescription": "Jan continue de réessayer. Tant que cela échoue, les messages récents n'existent que dans cette fenêtre.",
+ "retry": "Réessayer maintenant"
},
"threadRoute": {
"notReadyTitle": "Cette conversation n'est pas encore prête",
diff --git a/web-app/src/locales/ja/common.json b/web-app/src/locales/ja/common.json
index 5b219fa79..c5b6f606e 100644
--- a/web-app/src/locales/ja/common.json
+++ b/web-app/src/locales/ja/common.json
@@ -538,7 +538,16 @@
"missingThreadTitle": "Cowork会話を保存できませんでした",
"missingThreadDescription": "保存されているスレッドが見つからないため、変更は保存されなくなりました。読み取り、エクスポート、削除は引き続き可能です。",
"writeRefusedTitle": "Cowork会話を保存できません",
- "writeRefusedDescription": "Janはこの会話を現在のIDで保存できないため、変更は保存されません。読み取り、エクスポート、削除は引き続き可能です。"
+ "writeRefusedDescription": "Janはこの会話を現在のIDで保存できないため、変更は保存されません。読み取り、エクスポート、削除は引き続き可能です。",
+ "closeFailedTitle": "Janはすべてを保存できなかったため、開いたままです",
+ "closeFailedDescription": "最新の変更はまだメモリ上にあります。もう一度ウィンドウを閉じると、保存を再試行します。",
+ "closeForceDescription": "保存が失敗し続けています。保存せずに閉じることもできますが、書き込めなかった変更は失われます。",
+ "closeAnyway": "保存せずに閉じる"
+ },
+ "messageWrites": {
+ "failedTitle": "保存できなかったメッセージがあります",
+ "failedDescription": "Janは再試行を続けます。成功するまで、最近のメッセージはこのウィンドウ内にのみ存在します。",
+ "retry": "今すぐ再試行"
},
"threadRoute": {
"notReadyTitle": "この会話はまだ準備できていません",
diff --git a/web-app/src/locales/zh-CN/common.json b/web-app/src/locales/zh-CN/common.json
index 0076dcb03..d021a797d 100644
--- a/web-app/src/locales/zh-CN/common.json
+++ b/web-app/src/locales/zh-CN/common.json
@@ -600,7 +600,16 @@
"missingThreadTitle": "无法保存 Cowork 对话",
"missingThreadDescription": "其存储的会话线程已丢失,因此不再保存更改。您仍可阅读、导出或删除它。",
"writeRefusedTitle": "无法保存 Cowork 对话",
- "writeRefusedDescription": "Jan 无法以当前 ID 存储此对话,因此不会保存更改。您仍可阅读、导出或删除它。"
+ "writeRefusedDescription": "Jan 无法以当前 ID 存储此对话,因此不会保存更改。您仍可阅读、导出或删除它。",
+ "closeFailedTitle": "Jan 未能保存全部内容,因此保持打开",
+ "closeFailedDescription": "您最近的更改仍在内存中。再次关闭窗口即可重试保存。",
+ "closeForceDescription": "保存持续失败。您可以不保存直接关闭,但无法写入的更改将会丢失。",
+ "closeAnyway": "不保存并关闭"
+ },
+ "messageWrites": {
+ "failedTitle": "部分消息未能保存",
+ "failedDescription": "Jan 会继续重试。在成功之前,最近的消息只存在于此窗口中。",
+ "retry": "立即重试"
},
"threadRoute": {
"notReadyTitle": "此对话尚未就绪",