Skip to content

fix(poster-cleanarr): bypass the GET cache on status polls - #451

Merged
chodeus merged 1 commit into
mainfrom
fix/uncached-status-polls
Aug 6, 2026
Merged

fix(poster-cleanarr): bypass the GET cache on status polls#451
chodeus merged 1 commit into
mainfrom
fix/uncached-status-polls

Conversation

@chodeus

@chodeus chodeus commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Problem

Poster Cleanarr scans appeared to hang: the backend job finished in ~20 seconds, but the UI kept showing the scanning spinner for ~5 minutes, and retrying or navigating away restarted the wait.

Three pieces combine to cause it:

  1. Scan jobs are enqueued without a module_name in their payload (backend/api/posters.py), so GET /api/jobs/{id}/log-tail takes its no-module-log early return and echoes next_offset back unchanged — the poll URL never varies between calls.
  2. tailJobLog (frontend/src/utils/api/posters.js) called apiCore.get without opting out of the cache, and apiCore.get caches GET responses for 5 minutes by default.
  3. pollJobUntilDone polls every 1.5s until it sees a terminal status — but after the first real fetch, every subsequent poll of the identical URL was served the cached running response until the TTL expired.

The cleanup LiveLogModal shares tailJobLog, so a cleanup job's final status was likewise masked for up to 5 minutes after the last log line.

Fix

Pass useCache: false on the two live-status reads:

  • tailJobLog — the job log-tail poller (scan spinner + cleanup modal)
  • getExecutionStatus — live module execution status shown when expanding a running job on the Jobs page, previously also on the default 5-minute cache

Audit of the same class

Swept every apiCore.get for status/poll reads served by the default cache. All other pollers already opt out or use deliberate short TTLs: fetchRunStates (30s TTL, poll loops pass useCache: false), getJob (5s TTL, Jobs page poll passes useCache: false), getStats (30s), listJobs (10s), cl2k seasonsStatus/uploadStatus, poster-self-heal, border-replacerr preview, and webhook provision status (all useCache: false).

Verification

  • npm --prefix frontend run lint — pass
  • npx prettier --check src — pass
  • Backend job table confirmed healthy throughout (all scan jobs success within seconds); this is purely a frontend read-path fix.

Summary by CodeRabbit

  • Bug Fixes
    • Execution status updates now display the latest available information instead of potentially cached results.
    • Job log polling now reflects current output and terminal statuses more reliably.

The job log-tail poller and the module execution-status read went through
apiCore.get's default 5-minute cache. Scan jobs carry no module_name, so
the log-tail response echoes next_offset unchanged and the poll URL never
varies — every poll after the first was served the cached 'running'
status for the full TTL. A 20-second metadata scan showed the scanning
spinner for ~5 minutes, and any retry or renavigation restarted the wait.

Pass useCache: false on both reads; a status poll must never be cached.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 16659c9b-610a-47f8-84cb-fed05c2f6e0f

📥 Commits

Reviewing files that changed from the base of the PR and between 11f0c7d and b7be562.

📒 Files selected for processing (2)
  • frontend/src/utils/api/modules.js
  • frontend/src/utils/api/posters.js

📝 Walkthrough

Walkthrough

The API client now bypasses GET caching for execution status and job log polling. The job log documentation describes the cache bypass. Request parameters and endpoints remain unchanged.

Changes

Execution polling freshness

Layer / File(s) Summary
Disable caching for polling requests
frontend/src/utils/api/modules.js, frontend/src/utils/api/posters.js
getExecutionStatus and tailJobLog pass cache bypass options to apiCore.get. The tailJobLog documentation reflects this behavior.

Estimated code review effort: 2 (Simple) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: bypassing the GET cache for status polling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/uncached-status-polls

Comment @coderabbitai help to get the list of available commands.

@chodeus
chodeus merged commit 3594e3b into main Aug 6, 2026
13 checks passed
@chodeus
chodeus deleted the fix/uncached-status-polls branch August 6, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant