mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: harden Docker image and async job responses
Harden Docker runtime packaging, preserve async job response semantics, fix Redis subscriber startup connections, clear lint warnings, and harden enterprise S3 object body handling.
This commit is contained in:
@@ -72,6 +72,17 @@ function postOcrPdf(parts: Parameters<typeof createMultipartPayload>[0]) {
|
||||
});
|
||||
}
|
||||
|
||||
function expectAsyncAccepted(body: string, clientJobId: string) {
|
||||
const artifactJobId = mocks.enqueueToolJob.mock.calls.at(-1)?.[0].jobId;
|
||||
expect(artifactJobId).toBeDefined();
|
||||
expect(JSON.parse(body)).toEqual({
|
||||
jobId: clientJobId,
|
||||
progressJobId: clientJobId,
|
||||
artifactJobId,
|
||||
async: true,
|
||||
});
|
||||
}
|
||||
|
||||
describe("ocr-pdf route coverage", () => {
|
||||
it("rejects requests without a PDF after the bundle gate passes", async () => {
|
||||
const res = await postOcrPdf([
|
||||
@@ -136,7 +147,7 @@ describe("ocr-pdf route coverage", () => {
|
||||
]);
|
||||
|
||||
expect(res.statusCode).toBe(202);
|
||||
expect(JSON.parse(res.body)).toEqual({ jobId: clientJobId, async: true });
|
||||
expectAsyncAccepted(res.body, clientJobId);
|
||||
expect(mocks.enqueueToolJob).toHaveBeenCalledTimes(1);
|
||||
expect(mocks.enqueueToolJob).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
|
||||
Reference in New Issue
Block a user