Skip to content

[tuner E/#657] badge coverage cue: stale async report can restore the previous song's ring #678

Description

@byrongamatos

Found in review of #657 (passive 'different tuning' badge cue).

P2. In static/v3/badges.js, _refreshCoverageCue() awaits api.coverageReport(songInfo) then unconditionally writes _lastCoverageReport and the DOM. The clear paths (song:loading, non-player screen:changed) are synchronous and don't invalidate an in-flight request, so a slow /api/settings fetch can restore the previous song's amber ring after the next song started loading / after navigating away. It self-corrects on the next song:ready, but shows a transient wrong cue.

Fix: a monotonic request token bumped on song:ready/song:loading/screen:changed; apply the awaited report only if the token still matches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions