mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 14:40:52 +00:00
fix(labs): name a failed re-check as an error and close the last budget gaps
A re-check or reservation that failed itself stopped the scan as "unavailable", and the review screen said AI had been turned off. It now stops as stoppedBy error with its own message in every locale, and the failure is reported as one: an error signal and the worker error reporter. A scan that failed that way before any row answers 500 aiRuns.failed. The overspend booked before a further read is now net of the cached share, as the settlement books it. A reservation that names no known owner stops the scan instead of taking the user plan's larger cap. A page's text layer is cut at the last whole line; only a page whose first line alone runs past the cap keeps part of it, cut at a space or hard, rather than collapsing to the bare cut mark, and an endless line is no longer read past the cap. The unused per-call text limit is gone. The run result's description names every outcome a stopped scan can have.
This commit is contained in:
1 parent
e897549dff
commit
4c50f48b26
19 files changed
+279
-75
No files matched your search
@@ -306,6 +306,9 @@ describe("<OcrReadNotes> — what a read could not give", () => {
|
||||
expect(render({ unreadPages: [4], stoppedBy: "unavailable" })).toContain(
|
||||
"AI was turned off while the report was being read",
|
||||
);
|
||||
const failed = render({ unreadPages: [4], stoppedBy: "error" });
|
||||
expect(failed).toContain("because of a server error");
|
||||
expect(failed).not.toContain("AI was turned off");
|
||||
});
|
||||
|
||||
it("says how many readings the report had when it ran past the cap", () => {
|
||||
|
||||
@@ -548,7 +548,9 @@ export function OcrReadNotes({ notes }: { notes: OcrReadNotesValue }) {
|
||||
<p>
|
||||
{stoppedBy === "budget"
|
||||
? t("labs.ocr.stoppedBudget")
|
||||
: t("labs.ocr.stoppedUnavailable")}
|
||||
: stoppedBy === "error"
|
||||
? t("labs.ocr.stoppedError")
|
||||
: t("labs.ocr.stoppedUnavailable")}
|
||||
</p>
|
||||
) : null}
|
||||
{unreadPages ? (
|
||||
|
||||
Reference in new issue
Block a user