Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Move to another server: say what did not move and why, and stop retrying an app automation forever (#4382)

Aditya Umale7648dffef5cb
diff --git a/electron/cloud-send-kinds.mjs b/electron/cloud-send-kinds.mjs
index bac0d1d101..4715be7bff 100644
--- a/electron/cloud-send-kinds.mjs
+++ b/electron/cloud-send-kinds.mjs
@@ -103,7 +103,7 @@ export function createMoveKinds({ localJson, localBytes, localSend, entry, persi
if (!record(held) || !("record" in held)) throw Object.assign(new Error("It could not be read on this computer."), { code: "local" });
const sent = row.kind === "routine" && ctx.ownMove ? await routineDefinition(ctx, row, held) : held.record;
const answer = await ctx.session.call("PUT", "/api/cloud-send/kind", { v: 1, key: row.key, dataDir: held.dataDir, record: sent, ...(Array.isArray(held.runs) ? { runs: held.runs } : {}) });
- if (!answer.ok) throw Object.assign(new Error(refusal(answer, "My Cloud could not take it.")), answer.status === 400 || answer.status === 403 ? { final: true } : {});
+ if (!answer.ok) throw Object.assign(new Error(refusal(answer, "My Cloud could not take it.")), answer.status === 400 || answer.status === 403 || answer.body?.final === true ? { final: true } : {});
if (AUTOMATIONS.has(row.kind) && record(held.record)) {
entry(ctx.origin).on[row.key] = row.kind === "call" ? held.record.nextRunAt !== null && held.record.nextRunAt !== undefined : held.record.enabled === true;
persist();
diff --git a/electron/cloud-send-move.node-test.mjs b/electron/cloud-send-move.node-test.mjs
index 0b69793e62..daf6899e49 100644
--- a/electron/cloud-send-move.node-test.mjs
+++ b/electron/cloud-send-move.node-test.mjs
@@ -352,6 +352,19 @@ test("a move sends what only it carries last, after the chats and their settings
assert.deepEqual(move.deps.store.value.clouds[CLOUD].on, { "routine:r1": true, "app-event:e1": false }, "what was on here is kept for the switch, after this computer let go");
});
+test("an app event My Cloud refuses for good is left behind as final, and this computer keeps collecting it", async () => {
+ const event = { key: "app-event:e1", kind: "app-event", label: "Reply to email", id: "e1", bot: "ember", parts: { def: "d2" } };
+ const error = "This app automation stays on the computer it came from: connected apps are not set up on My Cloud. Set them up here, then make it again.";
+ const refusing = (body) => sides({ here: [bot("ember", { soul: "s" }), event], there: [bot("ember", { soul: "s" })], bots: { ember: { soul: "s" } },
+ onCall: (method, route) => method === "PUT" && route === "/api/cloud-send/kind" ? reply(409, body) : null });
+ const move = refusing({ error, final: true });
+ const final = await createCloudSend(move.deps).send({ reason: "move", final: true });
+ assert.deepEqual(final.result.failed, [{ key: "app-event:e1", kind: "app-event", label: "Reply to email", error: `My Cloud said: ${error}`, final: true }]);
+ assert.ok(!move.calls.some((call) => call.startsWith("HERE DELETE")), "this computer did not let go of it");
+ const busy = refusing({ error: "busy" });
+ assert.equal((await createCloudSend(busy.deps).send({ reason: "move", final: true })).result.failed[0].final, undefined, "a refusal that may pass is tried again");
+});
+
test("what a move carries last is never taken for removed on My Cloud, so a routine changed here before the final pass still goes", async () => {
// Seen in the real app on Oct 22: after a plain move, cloud-send.json had every routine and webhook it had just carried
// as "removed", because the pass's closing plan read My Cloud before the automations went.
diff --git a/electron/one-home.d.mts b/electron/one-home.d.mts
index d004fa3a7d..70cb3269ce 100644
--- a/electron/one-home.d.mts
+++ b/electron/one-home.d.mts
@@ -1,16 +1,20 @@
/** The line either page shows for the one-time move to My Cloud (one-home.mjs), or to a server of the person's own, named
* `place`. */
export type OneHomeView = OneHomePhase & { place?: string };
+/** Something a move could not carry, by its name, and why. */
+export type OneHomeNotCarried = { label: string; error: string };
+export type OneHomeFailing = { error: string | null; items?: OneHomeNotCarried[] };
type OneHomePhase =
- /** `chats`: conversations gone of those to go; `failing`: it has failed for a day, with why; `updating`: My Cloud is too old
+ /** `chats`: conversations gone of those to go; `failing`: it has failed for a day, or its check found things missing pass
+ * after pass, with why and what did not go; `updating`: My Cloud is too old
* to take a move and updates first. */
- | { phase: "copy"; chats?: { done: number; total: number }; failing?: { error: string | null }; updating?: true }
+ | { phase: "copy"; chats?: { done: number; total: number }; failing?: OneHomeFailing; updating?: true }
/** `waitingFor`: the bot or room whose work holds the move ("" when it has no name), and `waitingWhat` what it is;
* neither while it waits for a quiet moment or has not asked yet. */
- | { phase: "wait"; waitingFor?: string; waitingWhat?: "bot" | "room" | "sign-in"; failing?: { error: string | null } }
- | { phase: "finishing"; failing?: { error: string | null } }
- /** What arrived, checked on both sides; `at`: when the move was done; `phone`: a phone was paired with this computer; `held`: keys a trial's Cloud keeps unused while its Claude credit lasts. */
- | { phase: "done"; at?: number; counts?: OneHomeCounts; phone: boolean; held: string[] }
+ | { phase: "wait"; waitingFor?: string; waitingWhat?: "bot" | "room" | "sign-in"; failing?: OneHomeFailing }
+ | { phase: "finishing"; failing?: OneHomeFailing }
+ /** What arrived, checked on both sides; `at`: when the move was done; `phone`: a phone was paired with this computer; `held`: keys a trial's Cloud keeps unused while its Claude credit lasts; `left`: what My Cloud refused for good, which stayed where it was. */
+ | { phase: "done"; at?: number; counts?: OneHomeCounts; phone: boolean; held: string[]; left?: OneHomeNotCarried[] }
/** This computer's bots are on their way home from a My Cloud that goes on, because the person keeps them here;
* `updating`: My Cloud is too old to stop their automations and updates first. */
| { phase: "keeping"; updating?: true }
diff --git a/electron/one-home.mjs b/electron/one-home.mjs
index f5964da5b2..2bf8b609c1 100644
--- a/electron/one-home.mjs
+++ b/electron/one-home.mjs
@@ -45,6 +45,8 @@ export const FROZEN_RETRY_MS = HOUR;
/** A failure before the freeze (no network, My Cloud asleep or updating): tried again sooner at first, then hourly. */
export const COPY_RETRY_MS = [2 * MINUTE, 5 * MINUTE, 15 * MINUTE, 30 * MINUTE, HOUR];
export const FAILING_LINE_MS = DAY;
+/** At most this many of the things a move could not carry are named on its line. */
+const NAMED_MAX = 5;
/** This computer's copy is kept this long after the move, and until My Cloud has been paid for once. */
export const KEPT_MS = 30 * DAY;
const PHASES = new Set(["copy", "wait", "freeze", "final", "check", "switch", "done", "keeping", "home-again", "back"]);
@@ -211,19 +213,31 @@ export function createOneHome(deps) {
function phaseView() {
const journal = read();
if (!journal || journal.paused || (journal.told && journal.phase !== "keeping")) return null;
- if (journal.phase === "done") return { phase: "done", ...(Number.isSafeInteger(journal.doneAt) ? { at: journal.doneAt } : {}), ...(journal.counts ? { counts: journal.counts } : {}), phone: journal.phone === true, held: journal.held ?? [] };
+ if (journal.phase === "done") return { phase: "done", ...(Number.isSafeInteger(journal.doneAt) ? { at: journal.doneAt } : {}), ...(journal.counts ? { counts: journal.counts } : {}), phone: journal.phone === true, held: journal.held ?? [],
+ ...(journal.left?.length ? { left: journal.left } : {}) };
if (journal.phase === "keeping") return { phase: "keeping", ...(journal.updating ? { updating: true } : {}) };
if (journal.phase === "home-again" || journal.phase === "back") {
return { phase: journal.phase, ...(journal.lost ? { lost: true } : {}), ...(journal.elsewhere ? { elsewhere: journal.elsewhere } : {}), ...(journal.kept ? { kept: true } : {}),
...(journal.phase === "back" && journal.gone ? { gone: true } : {}) };
}
- const running = deps.send.snapshot?.()?.running;
+ const sent = deps.send.snapshot?.();
+ const running = sent?.running;
const chats = journal.phase === "copy" && running?.phase === "chats" && running.progress ? { done: running.progress.done, total: running.progress.total } : null;
if (journal.phase === "copy" && journal.updating && !running) return { phase: "copy", updating: true };
- const failing = journal.failingSince && now() - journal.failingSince >= FAILING_LINE_MS ? { error: journal.error ?? null } : null;
+ // A check that found things missing pass after pass is said at once, with what did not go: waiting helps none of it.
+ const failing = journal.failingSince && (journal.failure?.code === "incomplete" || now() - journal.failingSince >= FAILING_LINE_MS) ? { error: journal.error ?? null } : null;
+ const items = failing ? notCarried(sent, false) : [];
const phase = FROZEN.has(journal.phase) || journal.phase === "switch" ? "finishing" : journal.phase;
const waits = phase === "wait" && waitingFor !== null ? { waitingFor, ...(waitingWhat ? { waitingWhat } : {}) } : {};
- return { phase, ...(chats ? { chats } : {}), ...waits, ...(failing ? { failing } : {}) };
+ return { phase, ...(chats ? { chats } : {}), ...waits, ...(failing ? { failing: { ...failing, ...(items.length ? { items } : {}) } } : {}) };
+ }
+
+ /** What the last whole pass could not carry, each with why: all of it while the move is failing, only what My Cloud
+ * refused for good (`final`, which the move goes on without) once it is done. */
+ function notCarried(sent, onlyFinal) {
+ const failed = sent?.whole?.result?.failed;
+ return (Array.isArray(failed) ? failed : []).filter((entry) => typeof entry?.label === "string" && (!onlyFinal || entry.final === true))
+ .slice(0, NAMED_MAX).map((entry) => ({ label: entry.label, error: sentence(entry.error) ?? "It did not move." }));
}
/** Lifts this computer's freeze; true once it is lifted. */
@@ -341,8 +355,10 @@ export function createOneHome(deps) {
later(next.retryAt - now());
return null;
} finally { await session?.close().catch(() => {}); }
- const held = (deps.send.snapshot?.()?.whole?.result?.notes ?? []).filter((note) => note?.kind === "held" && typeof note.connection === "string").map((note) => note.connection);
- const done = write({ ...journal, phase: "done", switched, doneAt: now(), version: deps.version ?? null, phone: deps.phone?.paired() === true, held,
+ const sent = deps.send.snapshot?.();
+ const held = (sent?.whole?.result?.notes ?? []).filter((note) => note?.kind === "held" && typeof note.connection === "string").map((note) => note.connection);
+ const left = notCarried(sent, true);
+ const done = write({ ...journal, phase: "done", switched, doneAt: now(), version: deps.version ?? null, phone: deps.phone?.paired() === true, held, ...(left.length ? { left } : {}),
error: undefined, failingSince: undefined, retryAt: undefined, tries: undefined, failure: undefined });
await settle(done);
deps.openHome?.();
diff --git a/electron/one-home.node-test.mjs b/electron/one-home.node-test.mjs
index 7cd8e110f3..7069dac39c 100644
--- a/electron/one-home.node-test.mjs
+++ b/electron/one-home.node-test.mjs
@@ -44,7 +44,7 @@ function world({ cloud = {}, switches = { "routine:r1": true, "routine:r2": fals
},
async check() { w.checked++; return { ok: checks.shift() ?? true }; },
switches: () => switches,
- snapshot: () => ({ running: w.running ?? null, whole: { result: { notes: [{ kind: "held", connection: "OpenRouter" }] } } }),
+ snapshot: () => ({ running: w.running ?? null, whole: { result: { notes: [{ kind: "held", connection: "OpenRouter" }], failed: w.failed ?? [] } } }),
},
local: {
async freeze() {
@@ -191,6 +191,28 @@ test("a check's log line names the rooms and conversations it found missing by i
assert.equal(missingOf({}), "something");
});
+test("a check that still finds things missing after three passes says so at once, naming what did not go and why", async () => {
+ const w = world({ checks: [false, false, false] });
+ w.failed = [{ key: "skill:b1:tidy", kind: "skill", label: "tidy", error: "OpenMausBot on this computer did not answer. Try again in a moment." },
+ { key: "app-event:e1", kind: "app-event", label: "Reply to email", error: "This app automation stays on the computer it came from.", final: true }];
+ await w.home.kick();
+ assert.equal(w.journal.failure.code, "incomplete");
+ assert.ok(w.now() - w.journal.failingSince < FAILING_LINE_MS, "not a day later");
+ assert.deepEqual(w.home.view(), { phase: "copy", failing: { error: "Some of this computer's things did not reach My Cloud.", items: [
+ { label: "tidy", error: "OpenMausBot on this computer did not answer. Try again in a moment." },
+ { label: "Reply to email", error: "This app automation stays on the computer it came from." }] } });
+});
+
+test("a move done without what My Cloud refused for good names it on the done line", async () => {
+ const w = world();
+ w.failed = [{ key: "app-event:e1", kind: "app-event", label: "Reply to email", error: "This app automation stays on the computer it came from.", final: true }];
+ await w.home.kick();
+ assert.equal(w.journal.phase, "done");
+ assert.deepEqual(w.home.view().left, [{ label: "Reply to email", error: "This app automation stays on the computer it came from." }]);
+ w.failed = [];
+ assert.deepEqual(w.home.view().left, [{ label: "Reply to email", error: "This app automation stays on the computer it came from." }], "kept with the move, not read again");
+});
+
test("a check that still fails after three passes lifts the freeze and tries again in an hour; a day of it shows Try again", async () => {
const w = world({ checks: [false, false, false] });
await w.home.kick();
diff --git a/server/cloud-send-kinds.test.ts b/server/cloud-send-kinds.test.ts
index 4830725859..7b27fe1711 100644
--- a/server/cloud-send-kinds.test.ts
+++ b/server/cloud-send-kinds.test.ts
@@ -104,6 +104,34 @@ describe("My Cloud takes a routine", () => {
});
});
+describe("My Cloud takes an app event", () => {
+ const appEvents = (service: { available: true } | { available: false; reason: "self-hosted" | "unavailable" }) => {
+ const adopted: string[] = [];
+ return { adopted, list: () => [], remove: async () => false, service: () => service,
+ adopt: async (record: { id: string }) => { adopted.push(record.id); return record as never; } };
+ };
+ const event = { id: "t1", botId: "b1", name: "Reply to email", prompt: "Draft a reply.", app: "gmail", event: "GMAIL_NEW_GMAIL_MESSAGE", config: {}, enabled: true };
+
+ it("refuses it for good while connected apps are not set up there, so the move goes on without it", async () => {
+ for (const reason of ["unavailable", "self-hosted"] as const) {
+ const there = appEvents({ available: false, reason });
+ const answer = await take(deps(HERE, { appEvents: () => there as never }), itemKey.moved("app-event", "t1"), event);
+ expect(answer).toMatchObject({ status: 409, body: { final: true } });
+ expect(answer.body.error).toMatch(/stays on the computer it came from/u);
+ expect(there.adopted).toEqual([]);
+ }
+ });
+
+ it("takes it where connected apps are set up, and a refusal that may pass is not final", async () => {
+ const there = appEvents({ available: true });
+ expect((await take(deps(HERE, { appEvents: () => there as never }), itemKey.moved("app-event", "t1"), event)).status).toBe(200);
+ expect(there.adopted).toEqual(["t1"]);
+ const notYet = await take(deps(HERE), itemKey.moved("app-event", "t1"), event);
+ expect(notYet.status).toBe(503);
+ expect(notYet.body.final).toBeUndefined();
+ });
+});
+
describe("My Cloud takes a webhook and a call", () => {
it("a webhook gets an address and a secret of its own there and starts off; taken again, it keeps them and its switch", async () => {
const dir = mkdtempSync(join(tmpdir(), "omb-kinds-"));
diff --git a/server/cloud-send-kinds.ts b/server/cloud-send-kinds.ts
index 5c70916695..f43e58781c 100644
--- a/server/cloud-send-kinds.ts
+++ b/server/cloud-send-kinds.ts
@@ -50,7 +50,7 @@ export interface MoveKindsDeps {
routines(): Pick<RoutineManager, "listRoutines" | "listRuns" | "adopt"> | null;
calls(): Pick<CalendarCallManager, "list" | "adopt"> | null;
webhooks(): Pick<WebhookManager, "list" | "adopt"> | null;
- appEvents(): Pick<AppTriggerManager, "list" | "adopt" | "remove"> | null;
+ appEvents(): Pick<AppTriggerManager, "list" | "adopt" | "remove" | "service"> | null;
/** The person's Claude Code skills while this server uses them where they are; a move keeps them as imported skills. */
claudeCodeSkills(): ImportedSkillInput[];
instanceExists(id: string): boolean;
@@ -225,11 +225,13 @@ export function kindRecord(deps: MoveKindsDeps, kind: Kind, id: string): { recor
return skill ? { record: skill } : null;
}
+/** `final`: sending it again cannot help until the person changes something, so the move goes on without it. */
class Refused extends Error {
status: number;
- constructor(status: number, message: string) { super(message); this.status = status; }
+ final: boolean;
+ constructor(status: number, message: string, final = false) { super(message); this.status = status; this.final = final; }
}
-const refuse = (status: number, message: string): never => { throw new Refused(status, message); };
+const refuse = (status: number, message: string, final = false): never => { throw new Refused(status, message, final); };
const routineSchema = z.object({ id: z.string().regex(/^[\w-]{1,128}$/u), name: z.string().max(200), prompt: z.string().max(100_000), target: z.enum(["bot", "room-goal"]),
botId: z.string().min(1).max(128), groupId: z.string().max(128).optional(), runOn: z.enum(["maus", "cloud"]), schedule: z.record(z.string(), z.unknown()),
@@ -343,6 +345,10 @@ async function adopt(deps: MoveKindsDeps, kind: Kind, id: string, raw: unknown,
}
if (kind === "app-event") {
const triggers = deps.appEvents() ?? refuse(503, "My Cloud's app events are not ready yet.");
+ const service = triggers.service();
+ if (!service.available) refuse(409, service.reason === "self-hosted"
+ ? "This app automation stays on the computer it came from: My Cloud uses its own Composio key, so it cannot watch apps. Use a schedule or a webhook here instead."
+ : "This app automation stays on the computer it came from: connected apps are not set up on My Cloud. Set them up here, then make it again.", true);
await triggers.adopt({ ...rebased(raw as unknown as AppTrigger, from, deps.dataDir), id });
return;
}
@@ -403,7 +409,7 @@ export async function moveKindsRoute(deps: MoveKindsDeps, { req, res, path, meth
json(res, 405, { error: "method not allowed" });
} catch (error) {
const status = error instanceof Refused ? error.status : Number.isInteger((error as { status?: unknown }).status) ? (error as { status: number }).status : 500;
- json(res, status, { error: (error as Error).message?.slice(0, 300) || "It could not be moved." });
+ json(res, status, { error: (error as Error).message?.slice(0, 300) || "It could not be moved.", ...(error instanceof Refused && error.final ? { final: true } : {}) });
}
return true;
}
diff --git a/src/lib/cloud-send.test.ts b/src/lib/cloud-send.test.ts
index 0abf5c2c7a..f4d9b1b1b4 100644
--- a/src/lib/cloud-send.test.ts
+++ b/src/lib/cloud-send.test.ts
@@ -45,6 +45,17 @@ describe("the one-time move's line", () => {
expect(moveLine({ phase: "finishing", failing: { error: null } }, "local")?.text).toBe("Your bots couldn't move to My Cloud yet.");
});
+ it("names what did not move and why, on a failing line and on the done line, for My Cloud and a server of the person's own", () => {
+ const items = [{ label: "tidy", error: "OpenMausBot on this computer did not answer." }, { label: "Reply to email", error: "This app automation stays on the computer it came from." }];
+ const lines = ["tidy: OpenMausBot on this computer did not answer.", "Reply to email: This app automation stays on the computer it came from."];
+ expect(moveLine({ phase: "copy", failing: { error: "Some of this computer's things did not reach My Cloud.", items } }, "local")).toMatchObject({ kind: "failed", retry: true, extra: lines });
+ expect(moveLine({ phase: "copy", failing: { error: null, items }, place: "Garage server" }, "local")).toMatchObject({ kind: "failed", retry: true, extra: lines, place: "Garage server" });
+ const left = items.slice(1);
+ expect(moveLine({ phase: "done", phone: false, held: [], left }, "cloud")).toMatchObject({ kind: "done", text: "Everything else from this computer is here. These stayed on it:", extra: lines.slice(1) });
+ expect(moveLine({ phase: "done", phone: false, held: [], left, place: "Garage server" }, "cloud")).toMatchObject({ kind: "done", extra: lines.slice(1), place: "Garage server" });
+ expect(moveLine({ phase: "done", phone: false, held: [], left, place: "Garage server" }, "local")).toBeNull();
+ });
+
it("says once on My Cloud's page what arrived, a key kept for after the trial, and the phone to pair; on this computer, coming home", () => {
const done = moveLine({ phase: "done", counts: { bots: 4, skills: 2, logins: 2, onePassword: true, chats: 148, routines: 2 }, phone: true, held: ["OpenRouter"] }, "cloud");
expect(done).toMatchObject({ kind: "done", text: "Everything from this computer is here: 4 bots, 2 skills, 2 logins, 1Password, 148 chats, and 2 routines.", phone: true,
diff --git a/src/lib/cloud-send.ts b/src/lib/cloud-send.ts
index 9cd0ef7189..d51b90e774 100644
--- a/src/lib/cloud-send.ts
+++ b/src/lib/cloud-send.ts
@@ -1,6 +1,6 @@
// What either page says about the one-time move to My Cloud (electron/one-home.mjs), and what arrived, in words.
import type { CloudSendCounts } from "../../electron/cloud-send.mjs";
-import type { OneHomeCounts, OneHomeView } from "../../electron/one-home.mjs";
+import type { OneHomeCounts, OneHomeNotCarried, OneHomeView } from "../../electron/one-home.mjs";
import type { TeamMoveView } from "../../electron/team-move.mjs";
import type { LocaleKey } from "@/locales";
import { activeLocale, t } from "@/lib/i18n";
@@ -52,6 +52,9 @@ export function moveQuietUntil(move: OneHomeView | null | undefined): number {
return Infinity;
}
+/** What a move could not carry, one line each: its name, then why. */
+const notCarried = (items: OneHomeNotCarried[] | undefined) => (items ?? []).map((item) => `${item.label}: ${item.error}`);
+
/** The one-time move's line on either page: on its way (with progress, or who it waits for), almost done, failing for a
* day (with Try again), what arrived (on My Cloud's page, once), coming home, where the bots came home instead, or this
* computer's bots on their way home and home because the person keeps them here.
@@ -61,8 +64,8 @@ export function moveLine(move: OneHomeView, page: "local" | "cloud"): { kind: "s
if (move.phase === "done") {
if (page !== "cloud") return null;
const list = move.counts ? arrivedList(move.counts) : [];
- return { kind: "done", text: list.length ? t("cloudSend.move.done", { list: listOf(list) }) : t("cloudSend.move.doneAll"),
- extra: move.held.map((key) => t("cloudSend.result.held", { key })), ...(move.phone ? { phone: true as const } : {}) };
+ const text = move.left?.length ? t("cloudSend.move.doneLeft") : list.length ? t("cloudSend.move.done", { list: listOf(list) }) : t("cloudSend.move.doneAll");
+ return { kind: "done", text, extra: [...notCarried(move.left), ...move.held.map((key) => t("cloudSend.result.held", { key }))], ...(move.phone ? { phone: true as const } : {}) };
}
if (move.phase === "keeping") return { kind: "sending", text: t(move.updating ? "cloudSend.move.keepingUpdating" : "cloudSend.move.keeping"), extra: [] };
if (move.phase === "home-again" || move.phase === "back") {
@@ -80,8 +83,9 @@ export function moveLine(move: OneHomeView, page: "local" | "cloud"): { kind: "s
if (move.phase === "copy" && move.updating) return { kind: "sending", text: t("cloudSend.move.updating"), extra: [] };
const failing = "failing" in move ? move.failing : undefined;
if (failing) {
- return failing.error ? { kind: "failed", text: t("cloudSend.move.failing", { error: failing.error }), extra: [], retry: true, reason: failing.error }
- : { kind: "failed", text: t("cloudSend.move.failingPlain"), extra: [], retry: true };
+ const extra = notCarried(failing.items);
+ return failing.error ? { kind: "failed", text: t("cloudSend.move.failing", { error: failing.error }), extra, retry: true, reason: failing.error }
+ : { kind: "failed", text: t("cloudSend.move.failingPlain"), extra, retry: true };
}
if (move.phase === "finishing") return { kind: "sending", text: t("cloudSend.move.finishing"), extra: [] };
// Who holds the move, by name, or what it is; nothing is claimed while it only waits for a quiet moment.
@@ -99,11 +103,16 @@ export function moveLine(move: OneHomeView, page: "local" | "cloud"): { kind: "s
* that server's update, or failing for a day with Try again. Once done the window shows that server, which says nothing
* of it here. */
function ownMoveLine(move: OneHomeView, place: string, page: "local" | "cloud"): ReturnType<typeof moveLine> {
+ // What that server refused for good is said there, where the window opens once the move is done.
+ if (move.phase === "done" && page === "cloud" && move.left?.length) return { kind: "done", text: t("cloudSend.move.doneLeft"), extra: notCarried(move.left), place };
if (page !== "local" || !["copy", "wait", "finishing"].includes(move.phase)) return null;
- const line = (kind: "sending" | "failed", text: string, more: { retry?: true; reason?: string } = {}) => ({ kind, text, extra: [], place, ...more });
+ const line = (kind: "sending" | "failed", text: string, more: { retry?: true; reason?: string; extra?: string[] } = {}) => ({ kind, text, extra: [], place, ...more });
const failing = "failing" in move ? move.failing : undefined;
- if (failing) return failing.error ? line("failed", t("cloudSend.move.failingNamed", { place, error: failing.error }), { retry: true, reason: failing.error })
- : line("failed", t("cloudSend.move.failingPlainNamed", { place }), { retry: true });
+ if (failing) {
+ const extra = notCarried(failing.items);
+ return failing.error ? line("failed", t("cloudSend.move.failingNamed", { place, error: failing.error }), { retry: true, reason: failing.error, extra })
+ : line("failed", t("cloudSend.move.failingPlainNamed", { place }), { retry: true, extra });
+ }
if (move.phase === "copy" && move.updating) return line("sending", t("cloudSend.move.updatingNamed", { place }));
if (move.phase === "finishing") return line("sending", t("cloudSend.move.finishingNamed", { place }));
if (move.phase === "wait" && move.waitingFor !== undefined) {
diff --git a/src/locales/en.json b/src/locales/en.json
index e92a643fb9..ecff4f23b4 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -1209,6 +1209,7 @@
"cloudSend.move.failingPlainNamed": "Your bots couldn't move to {place} yet.",
"cloudSend.move.done": "Everything from this computer is here: {list}.",
"cloudSend.move.doneAll": "Everything from this computer is here.",
+ "cloudSend.move.doneLeft": "Everything else from this computer is here. These stayed on it:",
"cloudSend.move.phone": "Pair your phone with My Cloud",
"cloudSend.move.homeAgain": "My Cloud has ended, so your bots are back on this computer. What you did on My Cloud is on its way back too.",
"cloudSend.move.back": "My Cloud has ended, so your bots are back on this computer, with what you did on My Cloud. Logins and keys you added on My Cloud didn't come back: add them here again if you need them.",