chore(release): cut 0.4.0-beta.2

This commit is contained in:
Mohamed Boudra
2026-08-12 23:18:28 +02:00
parent ed0d4e6c5b
commit 44b9980a70
13 changed files with 77 additions and 41 deletions
@@ -25,6 +25,10 @@ class MemoryStorage implements ReplicaCacheStorage {
this.writes += 1;
this.values.set(key, value);
}
async removeItem(key: string): Promise<void> {
this.values.delete(key);
}
}
function workspace(
@@ -226,6 +230,38 @@ describe("ReplicaCache", () => {
});
});
it("clears a cache containing a timeline row that fails its schema", async () => {
const storage = new MemoryStorage();
const writer = new ReplicaCache(storage);
writer.setHosts([SERVER_ID]);
seedSession();
await writer.flush();
const payload = JSON.parse(storage.values.get("@paseo:replica-cache") ?? "null") as {
hosts: Array<{ timeline: { items: unknown[] } | null }>;
};
const timeline = payload.hosts[0]?.timeline;
if (!timeline) throw new Error("Expected cached timeline");
timeline.items = [
{
kind: "todo_list",
id: "legacy-todo",
timestamp: { __paseoDate: "2026-08-11T08:02:00.000Z" },
provider: "codex",
items: [{ text: "Ship it", completed: false }],
},
];
storage.values.set("@paseo:replica-cache", JSON.stringify(payload));
useSessionStore.getState().clearSession(SERVER_ID);
const reader = new ReplicaCache(storage);
reader.setHosts([SERVER_ID]);
await reader.restore();
expect(storage.values.has("@paseo:replica-cache")).toBe(false);
expect(useSessionStore.getState().sessions[SERVER_ID]).toBeUndefined();
});
it("persists only the focused agent view with a short timeline tail", async () => {
const storage = new MemoryStorage();
const cache = new ReplicaCache(storage);