Skip to content

[Bug]: Crash (EXC_BREAKPOINT) when adding a Custom Metrics source via the file importer #47

Description

@Kazy1014

App Version

1.0 (build 1.0.3)

Device Model

MacBook Pro (Apple M5 Pro)

OS Version

macOS 26.5.2 (25F84)

Describe the bug

The app crashes immediately when adding a Custom Metrics source.
In Settings → Metrics → Custom Metrics, clicking Add Custom Metrics
Source
, choosing a .json file, and confirming the panel terminates the
app with EXC_BREAKPOINT (SIGTRAP).

The crash is reproducible (happened on every attempt). The trap occurs inside
SwiftUI's file-importer completion handler, i.e. before the app's own
onCompletion body runs, so it appears to be independent of the contents or
validity of the selected JSON file.

Crash signature (top frames, framework symbols only):

EXC_BREAKPOINT (SIGTRAP)
SwiftUI   closure #1 in View.fileImporter(isPresented:allowedContentTypes:onCompletion:)
SwiftUI   closure #1 in FileImportExportBridge.presentImportPicker(operation:)
SwiftUI   thunk for @escaping @callee_guaranteed (@unowned NSModalResponse) -> ()
AppKit    -[NSSavePanel didEndPanelWithReturnCode:]
AppKit    -[NSSavePanel didEndSheet:returnCode:contextInfo:]
AppKit    NSWindowEndWindowModalSession

How to reproduce

  1. Open Settings → Metrics → Custom Metrics.
  2. Click Add Custom Metrics Source.
  3. Select any .json file and confirm.
  4. The app crashes on panel dismissal.

Expected behavior

The selected JSON file is registered as a Custom Metrics source and its card
appears on the dashboard, without crashing.

Screenshots

N/A (crash on panel dismissal).

Additional notes / possible causes

I have not been able to pin down a single definitive cause, so the following
are hypotheses rather than conclusions. Compared with the Custom Runner image
importer (CustomRunnerEditorView), which uses .fileImporter and does not
crash, the Custom Metrics importer differs in two ways that may be relevant:

  1. Presentation context. The Custom Metrics importer is attached to a
    Section directly inside the top-level SettingsView, i.e. presented from
    within the SwiftUI Settings { } scene of a menu-bar / accessory-style app.
    The working runner importer is presented from a .sheet
    (CustomRunnerEditorView) layered on top of the Settings window, not from
    the Settings scene itself. A file panel presented directly from the
    Settings scene in an accessory app may be the trigger.

    • Crashing: CustomMetricsSettingsSectionView.swift (.fileImporter on the Section)
    • Working: CustomRunnerEditorView.swift (.fileImporter inside a sheet)
  2. .fileDialog* modifiers. The Custom Metrics importer additionally
    applies .fileDialogMessage(...) and .fileDialogConfirmationLabel(...);
    the runner importer applies neither. If these modifiers are involved, the
    crash may reproduce more broadly.

Both are guesses — the maintainers are better placed to judge which (if either)
is the actual cause.

Check List

  • I have read the CONTRIBUTING.md and agree to follow it.
  • Uninstalled App. (not performed — this is a source-level crash reproducible from the code path, unrelated to install state)
  • Re-launched your computer. (not performed — same reason)
  • Checked that no similar issues already exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions