Skip to content

Non-stable version notification never renders unless show_on_latest is also enabled #710

Description

@kuzdogan

Summary

The version-warning notification for non-stable versions never renders unless show_on_latest is also enabled, because the calculation it depends on is gated behind the wrong flag.

Root cause

stableVersionAvailable (and urls.stable) are only computed inside calculateStableLatestVersionWarning(). That method is called from a single guarded expression:

get(config, "addons.notifications.show_on_latest", false)   // ← gate
  && versioning_scheme !== "single_version_without_translations"
  && current.type !== "external"
  && this.calculateStableLatestVersionWarning();

The guard checks show_on_latest, but render()'s non-stable branch also depends on stableVersionAvailable:

!readingStableVersion && stableVersionAvailable
  && current.slug !== default_version
  && show_on_non_stable     renderStableVersionWarning()

So if a project enables only show_on_non_stable (not show_on_latest), calculateStableLatestVersionWarning() is never called → stableVersionAvailable stays false → the non-stable warning silently renders nothing, even though the addon is enabled and a stable version exists.

Suggested fix

Run calculateStableLatestVersionWarning() whenever any of show_on_latest / show_on_non_stable / show_on_external is set — or run it unconditionally (it only reads config) and let render() decide what to show. The stable/latest computation should not be gated on show_on_latest specifically.

Posted with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions