diff options
| author | Adam <[email protected]> | 2025-12-20 04:57:39 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-20 04:57:39 -0600 |
| commit | 49567fe61aea76871866bb816f27743f57708af2 (patch) | |
| tree | ee42f7b3d33875a28668575d2a18c95a7cb9e436 /packages/desktop/src/context/sync.tsx | |
| parent | e5b3f796e4c2e2ff12939dfc5e523ab9bd042f51 (diff) | |
| download | opencode-49567fe61aea76871866bb816f27743f57708af2.tar.gz opencode-49567fe61aea76871866bb816f27743f57708af2.zip | |
fix(desktop): add retries to init promises
Diffstat (limited to 'packages/desktop/src/context/sync.tsx')
| -rw-r--r-- | packages/desktop/src/context/sync.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/desktop/src/context/sync.tsx b/packages/desktop/src/context/sync.tsx index ca25cae98..941b8b629 100644 --- a/packages/desktop/src/context/sync.tsx +++ b/packages/desktop/src/context/sync.tsx @@ -1,6 +1,7 @@ import { produce } from "solid-js/store" import { createMemo } from "solid-js" import { Binary } from "@opencode-ai/util/binary" +import { retry } from "@opencode-ai/util/retry" import { createSimpleContext } from "@opencode-ai/ui/context" import { useGlobalSync } from "./global-sync" import { useSDK } from "./sdk" @@ -61,10 +62,10 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({ }, async sync(sessionID: string, _isRetry = false) { const [session, messages, todo, diff] = await Promise.all([ - sdk.client.session.get({ sessionID }, { throwOnError: true }), - sdk.client.session.messages({ sessionID, limit: 100 }), - sdk.client.session.todo({ sessionID }), - sdk.client.session.diff({ sessionID }), + retry(() => sdk.client.session.get({ sessionID })), + retry(() => sdk.client.session.messages({ sessionID, limit: 100 })), + retry(() => sdk.client.session.todo({ sessionID })), + retry(() => sdk.client.session.diff({ sessionID })), ]) setStore( produce((draft) => { |
