Skip to content

Fix chart refresh race showing stale 'missing' rows after refresh button#120

Merged
darious merged 1 commit intomainfrom
bugfix/chart_refresh_race
Apr 18, 2026
Merged

Fix chart refresh race showing stale 'missing' rows after refresh button#120
darious merged 1 commit intomainfrom
bugfix/chart_refresh_race

Conversation

@darious
Copy link
Copy Markdown
Owner

@darious darious commented Apr 18, 2026

The /charts/refresh endpoint queued refresh_chart_task via BackgroundTasks and returned immediately; the UI invalidated after a fixed 5s timeout. The refresh takes ~10s, so the page re-fetched before the DELETE+INSERT transaction had committed and rendered the prior (often wrong-MBID) rows, making them appear as 'missing' in the library until a full page reload.

Await the task inline so the HTTP response returns only once chart_album is fully updated, and invalidate the page data immediately on resolve.

The /charts/refresh endpoint queued refresh_chart_task via BackgroundTasks
and returned immediately; the UI invalidated after a fixed 5s timeout.
The refresh takes ~10s, so the page re-fetched before the DELETE+INSERT
transaction had committed and rendered the prior (often wrong-MBID) rows,
making them appear as 'missing' in the library until a full page reload.

Await the task inline so the HTTP response returns only once chart_album
is fully updated, and invalidate the page data immediately on resolve.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@darious darious merged commit 930101c into main Apr 18, 2026
3 checks passed
@darious darious deleted the bugfix/chart_refresh_race branch April 19, 2026 21:37
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