mirror of
https://github.com/stablyai/orca.git
synced 2026-10-22 08:03:37 +00:00
Handle mobile RPC reconnect rejections
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -499,9 +499,11 @@ export default function HostScreen() {
|
||||
const openWorktreeSession = useCallback(
|
||||
(item: Worktree) => {
|
||||
if (client && connState === 'connected') {
|
||||
void client.sendRequest('worktree.activate', {
|
||||
worktree: `id:${item.worktreeId}`
|
||||
})
|
||||
void client
|
||||
.sendRequest('worktree.activate', {
|
||||
worktree: `id:${item.worktreeId}`
|
||||
})
|
||||
.catch(() => null)
|
||||
}
|
||||
router.push(
|
||||
`/h/${hostId}/session/${encodeURIComponent(item.worktreeId)}?name=${encodeURIComponent(item.displayName || item.repo)}`
|
||||
@@ -972,9 +974,11 @@ export default function HostScreen() {
|
||||
onPress: () => {
|
||||
if (client) {
|
||||
setSleptIds((prev) => new Set(prev).add(actionTarget.worktreeId))
|
||||
void client.sendRequest('worktree.sleep', {
|
||||
worktree: `id:${actionTarget.worktreeId}`
|
||||
})
|
||||
void client
|
||||
.sendRequest('worktree.sleep', {
|
||||
worktree: `id:${actionTarget.worktreeId}`
|
||||
})
|
||||
.catch(() => null)
|
||||
}
|
||||
setActionTarget(null)
|
||||
}
|
||||
|
||||
@@ -264,9 +264,10 @@ export function connect(
|
||||
}
|
||||
|
||||
function rejectAllPending(reason: string) {
|
||||
const error = new Error(reason)
|
||||
for (const [id, req] of pending) {
|
||||
req.reject(new Error(reason))
|
||||
pending.delete(id)
|
||||
queueMicrotask(() => req.reject(error))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user