Q195: a change reloads only what is not already shown, and the snapshot stops carrying records the window never reads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-09 09:20:45 -04:00
1 parent 2f79e4261f
commit 56eac39b1b
31 files changed
+146 -214

No files matched your search

+4 -4
View File
@@ -1,3 +1,4 @@
import { tableRows } from "../helpers/table-rows";
import { join } from "node:path";
import { tmpdir } from "node:os";
import { randomUUID } from "node:crypto";
@@ -238,7 +239,7 @@ describe("provider service", () => {
responseText: "api_key:gpt-5.4:Draft board memo",
state: "succeeded",
});
expect(state.operationalEvents[0]).toMatchObject({ signalKey: "provider_request_success", source: "provider_gateway", success: true });
expect(tableRows(connection.db, "operational_events", "created_at desc", ["success"])[0]).toMatchObject({ signalKey: "provider_request_success", source: "provider_gateway", success: true });
expect(state.providers.find((provider) => provider.id === openAiProviderId)?.healthState).toBe("healthy");
connection.close();
});
@@ -246,7 +247,6 @@ describe("provider service", () => {
test("records provider response rate limit observations", async () => {
const connection = createConnection();
const organization = new OrganizationService(connection.db);
const snapshot = new SnapshotService(connection.db);
const adapters: ProviderAdapterRegistry = {
...providerAdapters,
openai: {
@@ -281,7 +281,7 @@ describe("provider service", () => {
instructions: null,
});
expect(snapshot.load().providerRateLimitObservations[0]).toMatchObject({
expect(tableRows(connection.db, "provider_rate_limit_observations", "observed_at desc")[0]).toMatchObject({
orgId,
providerId: openAiProviderId,
providerKey: "openai",
@@ -337,7 +337,7 @@ describe("provider service", () => {
state: "failed",
errorMessage: "rate limited",
});
expect(state.providerRateLimitObservations[0]).toMatchObject({
expect(tableRows(connection.db, "provider_rate_limit_observations", "observed_at desc")[0]).toMatchObject({
orgId,
providerId: openAiProviderId,
providerKey: "openai",