@indigoai-us/hq-cloud 6.16.55 → 6.16.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/sync-runner-company.d.ts.map +1 -1
- package/dist/bin/sync-runner-company.js +50 -2
- package/dist/bin/sync-runner-company.js.map +1 -1
- package/dist/bin/sync-runner-company.test.js +248 -1
- package/dist/bin/sync-runner-company.test.js.map +1 -1
- package/dist/bin/sync-runner.d.ts +6 -0
- package/dist/bin/sync-runner.d.ts.map +1 -1
- package/dist/bin/sync-runner.js.map +1 -1
- package/dist/bin/sync-runner.test.js +58 -0
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/context.d.ts +5 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +92 -12
- package/dist/context.js.map +1 -1
- package/dist/context.test.js +77 -2
- package/dist/context.test.js.map +1 -1
- package/dist/lib/net-errors.d.ts +12 -0
- package/dist/lib/net-errors.d.ts.map +1 -1
- package/dist/lib/net-errors.js +35 -0
- package/dist/lib/net-errors.js.map +1 -1
- package/dist/lib/net-errors.test.js +19 -1
- package/dist/lib/net-errors.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -2163,6 +2163,64 @@ describe("per-company fanout", () => {
|
|
|
2163
2163
|
expect.objectContaining({ company: "acme", status: "transient-network" }),
|
|
2164
2164
|
]);
|
|
2165
2165
|
});
|
|
2166
|
+
it("429 on every entity-fetch attempt is reported as transient, not errored", async () => {
|
|
2167
|
+
const throttle = Object.assign(new Error('Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 429 {"message":"Too Many Requests"}'), { statusCode: 429 });
|
|
2168
|
+
const deps = makeDeps({
|
|
2169
|
+
createVaultClient: () => makeVaultStub({
|
|
2170
|
+
memberships: [{ companyUid: "cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG" }],
|
|
2171
|
+
entityGet: (uid) => Promise.resolve({ uid, slug: "indigo" }),
|
|
2172
|
+
}),
|
|
2173
|
+
sync: vi.fn().mockRejectedValue(throttle),
|
|
2174
|
+
});
|
|
2175
|
+
expect(await runRunner(["--companies"], deps)).toBe(TRANSIENT_NETWORK_EXIT);
|
|
2176
|
+
expect(deps.stderr
|
|
2177
|
+
.events()
|
|
2178
|
+
.some((e) => e.type === "error" && e.company === "indigo")).toBe(false);
|
|
2179
|
+
expect(deps.stdout.events().find((e) => e.type === "transient-network")).toMatchObject({
|
|
2180
|
+
company: "indigo",
|
|
2181
|
+
path: "(company)",
|
|
2182
|
+
message: expect.stringContaining("Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 429"),
|
|
2183
|
+
});
|
|
2184
|
+
const all = deps.stdout
|
|
2185
|
+
.events()
|
|
2186
|
+
.find((e) => e.type === "all-complete");
|
|
2187
|
+
expect(all.partial).toBe(true);
|
|
2188
|
+
expect(all.errors).toEqual([]);
|
|
2189
|
+
expect(all.transient).toEqual([
|
|
2190
|
+
{
|
|
2191
|
+
company: "indigo",
|
|
2192
|
+
message: expect.stringContaining('Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 429 {"message":"Too Many Requests"}'),
|
|
2193
|
+
},
|
|
2194
|
+
]);
|
|
2195
|
+
expect(all.companies).toEqual([
|
|
2196
|
+
expect.objectContaining({ company: "indigo", status: "transient-network" }),
|
|
2197
|
+
]);
|
|
2198
|
+
});
|
|
2199
|
+
it("a 403 entity fetch is still errored immediately with no retry", async () => {
|
|
2200
|
+
const forbidden = Object.assign(new Error('Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 403 {"message":"Forbidden"}'), { statusCode: 403 });
|
|
2201
|
+
const deps = makeDeps({
|
|
2202
|
+
createVaultClient: () => makeVaultStub({
|
|
2203
|
+
memberships: [{ companyUid: "cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG" }],
|
|
2204
|
+
entityGet: (uid) => Promise.resolve({ uid, slug: "indigo" }),
|
|
2205
|
+
}),
|
|
2206
|
+
sync: vi.fn().mockRejectedValue(forbidden),
|
|
2207
|
+
});
|
|
2208
|
+
expect(await runRunner(["--companies"], deps)).toBe(PARTIAL_SYNC_EXIT);
|
|
2209
|
+
expect(deps.stderr.events().find((e) => e.type === "error" && e.company === "indigo" && e.path === "(company)")).toMatchObject({
|
|
2210
|
+
message: expect.stringContaining("Failed to fetch entity cmp_01KQ2RYAHXHDPCTY9GPQPTH3DG: 403"),
|
|
2211
|
+
});
|
|
2212
|
+
expect(deps.stdout
|
|
2213
|
+
.events()
|
|
2214
|
+
.some((e) => e.type === "transient-network")).toBe(false);
|
|
2215
|
+
const all = deps.stdout
|
|
2216
|
+
.events()
|
|
2217
|
+
.find((e) => e.type === "all-complete");
|
|
2218
|
+
expect(all.errors).toEqual([expect.objectContaining({ company: "indigo" })]);
|
|
2219
|
+
expect(all.transient).toEqual([]);
|
|
2220
|
+
expect(all.companies).toEqual([
|
|
2221
|
+
expect.objectContaining({ company: "indigo", status: "errored" }),
|
|
2222
|
+
]);
|
|
2223
|
+
});
|
|
2166
2224
|
it("keeps deterministic company failures as exit 2 errors", async () => {
|
|
2167
2225
|
const deps = makeDeps({
|
|
2168
2226
|
createVaultClient: () => makeVaultStub({
|