fix: результат редактирования не появлялся в окне «Результат появится здесь» — корень: браузер кэшировал ответ /api/jobs/:id/status со статусом «running» (не было Cache-Control), и последний финальный запрос получал stale-ответ с result=null
All checks were successful
test / test (push) Successful in 10s

This commit is contained in:
2026-08-28 01:19:17 +07:00
parent 6f611dc697
commit b4ea8df840
3 changed files with 4 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ function createJobsRoutes({ jobService }) {
router.get("/jobs", (req, res, next) => {
try {
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
res.json({ ok: true, jobs: jobService.listJobs() });
} catch (err) {
next(err);
@@ -22,6 +23,7 @@ function createJobsRoutes({ jobService }) {
router.get("/jobs/:id/status", (req, res, next) => {
try {
res.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
const { id } = req.params;
if (!JOB_ID_PATTERN.test(id)) {
throw new BadRequestError("Некорректный идентификатор задания.");