Skip to content

Util.Logger.warning is not a function, so onTrayIconRemoved throws instead of warning #644

Description

@ReyMoss

Problem

trayIconsManager.js:93 calls Util.Logger.warning(), but logger.js only defines debug, warn, error and critical. The catch block throws a TypeError of its own, so the intended diagnostic never reaches the log.

onTrayIconRemoved(_tray, icon) {
    try {
        const [trayIcon] = IndicatorStatusIcon.getTrayIcons().filter(i => i.icon === icon);
        trayIcon.destroy();
    } catch (e) {
        Util.Logger.warning(`No icon container found for ${icon.title} (${icon})`);
    }
}

When nothing matches the filter, trayIcon is undefined, .destroy() throws, and the handler meant to explain that throws too. The failure is silent apart from the misleading TypeError.

Observed

One line per boot in the journal, on both of my machines:

JS ERROR: TypeError: Util.Logger.warning is not a function

Fix

Util.Logger.warn. PR #638 contained this one word change plus a null guard, but its author closed it without discussion and master still reads warning.

Environment

  • Extension version 64
  • GNOME Shell 50.2, Wayland
  • NixOS 26.11, two machines, both affected

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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