Skip to content

SPA bug: loadDmxProfiles referenced but never defined — Settings → Profiles section initialization throws #880

@SlyWombat

Description

@SlyWombat

Summary

Discovered while capturing screenshots for the v1.7.119 manual update on 2026-05-11. Opening Settings → Profiles via the navigation throws ReferenceError: loadDmxProfiles is not defined. The function is referenced in two places but defined nowhere.

Evidence (HEAD = 82bd92c)

  • desktop/shared/spa/js/settings.js:16 calls loadDmxProfiles() unguarded:
    if(s==='profiles')loadDmxProfiles();
  • desktop/shared/spa/js/profiles.js calls it seven times but always guarded by typeof loadDmxProfiles === 'function':
    profiles.js:495, 507, 668, 679, 695, 778
    
  • No definition exists in any .js file:
    $ git grep -n 'function loadDmxProfiles\|loadDmxProfiles\s*=' desktop/shared/spa/js/
    (no hits)
    

The guards in profiles.js suggest the function was intended to be defined elsewhere (perhaps as part of a deferred-load module) but the definition was lost or never landed. The single unguarded call in settings.js:16 then crashes the section-initialization path.

Reproduction

  1. Open the SPA at http://localhost:<port>.
  2. Navigate to Settings → Profiles.
  3. Console shows: Uncaught ReferenceError: loadDmxProfiles is not defined at _setSection in settings.js.

Observed symptom for the operator: the Profiles sub-section either doesn't initialize, or relies on other code paths (e.g. the initial page-load chain) to populate. The Playwright capture script for the manual screenshots had to swallow the thrown error and toggle #ss-profiles visibility directly to get a snapshot.

Proposed fix sketch

The expected definition probably belongs in profiles.js itself — a top-level async function that fetches /api/dmx-profiles and renders the local / community / OFL panes. The guarded callsites in profiles.js look like they expected this. Sketch:

async function loadDmxProfiles() {
  try {
    const r = await fetch('/api/dmx-profiles');
    const data = await r.json();
    renderProfilesList(data);  // existing renderer
  } catch (e) {
    console.warn('loadDmxProfiles failed:', e);
  }
}

Or — alternative — strip the unguarded callsite at settings.js:16 (consistent with profiles.js's typeof-guard pattern) and replace with if(s==='profiles' && typeof loadDmxProfiles === 'function') loadDmxProfiles();. But that papers over the missing definition; better to actually define it.

Acceptance

  • loadDmxProfiles is defined exactly once in desktop/shared/spa/js/.
  • Settings → Profiles section initializes without console errors on a fresh page load.
  • All seven typeof-guarded callsites in profiles.js find the function and fire (verify via console.log during a community-share or OFL-import flow).
  • Playwright capture script tests/capture_manual_screenshots_v1_7_119.py no longer needs the try/except workaround for the Profiles section.

Related

  • Surfaced during the v1.7.119 user-manual update screenshot capture (2026-05-11).
  • The Playwright capture script lives at tests/capture_manual_screenshots_v1_7_119.py — it has the working workaround if you want to see the symptom in code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions