Spaces:
Running
Running
Commit History
14 days ago
-
Upload scripts/sync-catalogue.mjs
Verified signature0aa45f0 -
fix(sync): fail loudly on a PARTIAL mirror, and match entrypoint by realpath
Verified signatureTwo defects in the mirror sync, both of which produce "sửa sp không đồng bộ" with no error anywhere. 1) A partial fetch failure exited 0. The good file was written, the bad one was not — but public/catalogue is already committed, so the failed file stayed on disk as its previous version. refresh-catalogue.mjs then passed its requireRealFile + recordCount guards on that stale data, built, committed and printed REFRESH_OK. Result: products.json fresh, promos.json stale, so upstream edits and deletes silently stopped applying. That contradicts this file's own failure policy (and refresh-catalogue.mjs's): the previously committed mirror keeps serving. It did not — the push replaced it with a mixed one. Now ANY source failure fails the run, so the caller aborts before build/push and the last-good mirror stays live. The good file is still written, so one transient error does not discard a successful fetch; it just may not be published. 2) The direct-run c…1a32c2e -
Upload scripts/sync-catalogue.mjs
Verified signaturec86d53a