fix(cf): bump modal poll 90→180s + pin CF list to /api/ancpi pre-Faza H
Three independent issues from the live test on 50198: 1. CfOrderModal poll timeout was 90s but ANCPI orders routinely take 60-180s end-to-end. The 50198 order completed at 129s (logs show 6 polls before docs matched), but the modal had already errored out 39s before that with "Procesarea durează mai mult decât ne-am așteptat". Bump to 180s + update the user-facing copy from "60 de secunde" to "3 minute" so the expectation matches reality. 2. cfApiBase(useGisAc=true) routed pilot users to /api/cf which proxies to gis-api → gis_core."CfExtract", but the ePay queue still writes ONLY to architools_postgres."CfExtract". Pilot users were therefore blind to their own fresh orders in the listing + catalog checks (50198 invisible despite being completed + downloadable). Pin all CF API calls to legacy /api/ancpi until Faza H mirrors writes to gis-api too; the source of truth then becomes a single table. 3. Manual cleanup of one stuck order in gis_enrichment.CfExtract (354686, pending since 2026-05-19) — never advanced past `pending`, was showing up as "În coadă" in the Extrase CF tab for ~4 days. Set status=cancelled with an explanatory errorMessage. (Applied via direct SQL on postgres-gis; no code change for this.) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -65,7 +65,11 @@ interface Props {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const POLL_INTERVAL_MS = 3_000;
|
const POLL_INTERVAL_MS = 3_000;
|
||||||
const POLL_TIMEOUT_MS = 90_000;
|
// ANCPI orders regularly take 60-180s end-to-end (depends on cart load
|
||||||
|
// + ANCPI document queue); a 90s timeout was firing before the order
|
||||||
|
// finished even when the queue completed correctly. 180s catches the
|
||||||
|
// long tail without giving the user a "stuck forever" feel.
|
||||||
|
const POLL_TIMEOUT_MS = 180_000;
|
||||||
|
|
||||||
export function CfOrderModal({
|
export function CfOrderModal({
|
||||||
open,
|
open,
|
||||||
@@ -484,7 +488,7 @@ export function CfOrderModal({
|
|||||||
/>
|
/>
|
||||||
{phase === "processing" && (
|
{phase === "processing" && (
|
||||||
<p className="pt-1 text-[11px] italic text-muted-foreground">
|
<p className="pt-1 text-[11px] italic text-muted-foreground">
|
||||||
Poate dura până la 60 de secunde. Poți închide fereastra —
|
Poate dura până la 3 minute. Poți închide fereastra —
|
||||||
comanda continuă în fundal.
|
comanda continuă în fundal.
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -14,8 +14,15 @@
|
|||||||
|
|
||||||
import type { CfExtractRow } from "@/lib/gis-api-client";
|
import type { CfExtractRow } from "@/lib/gis-api-client";
|
||||||
|
|
||||||
export function cfApiBase(useGisAc: boolean): string {
|
export function cfApiBase(_useGisAc: boolean): string {
|
||||||
return useGisAc ? "/api/cf" : "/api/ancpi";
|
// Temporarily pinned to legacy /api/ancpi until Faza H lands.
|
||||||
|
// Background: pilot users (useGisAc=true) were routed to /api/cf
|
||||||
|
// which proxies to gis-api → gis_core."CfExtract". But the ePay queue
|
||||||
|
// still writes only to architools_postgres."CfExtract" (legacy). Pilot
|
||||||
|
// users were missing their own fresh orders in the listing + catalog
|
||||||
|
// checks. Until the queue mirrors writes to gis-api, every caller
|
||||||
|
// uses the legacy endpoint so the read source matches the write source.
|
||||||
|
return "/api/ancpi";
|
||||||
}
|
}
|
||||||
|
|
||||||
// UI-side row shape (mirrors what epay-tab.tsx already expects).
|
// UI-side row shape (mirrors what epay-tab.tsx already expects).
|
||||||
|
|||||||
Reference in New Issue
Block a user