Repository navigation
Description
Problem
Clicking Play on a device replay during the tutorial crashed the maintainer's signed Stim Desktop 0.1.27 (2358) on macOS 27.0 (26A428). AppKit raised from _postWindowNeedsUpdateConstraints while tutorial progress published another update during window layout.
Evidence
- User supplied crash screenshot and Play/replay trigger.
- Local report: ~/Library/Logs/DiagnosticReports/StimDesktop-2026-10-13-132059.ips, timestamp 2026-10-13 13:20:59 -0400; EXC_BREAKPOINT/SIGTRAP, faulting main thread.
- Application exception frames 22-24: TutorialModel.update -> RootView.updateTutorial -> RootView's tutorial viewer-event subscription, inside NSHostingView.layout.
- At origin/main 4895e71, DeviceViewer.swift's ReplayingContent creates
replay.$replay.map { ($0?.rate ?? 0) > 0 }.removeDuplicates()inside its body and reports onPlay whenever the subscription receives true. - onPlay appends TutorialViewerEvents.replayPlayed; RootView subscribes and updates published tutorial state. Rebuilding the view creates a new mapped publisher with fresh duplicate state; the current true playback value can report Play again.
- Earlier tutorial Lottie fix fix(desktop): give the tutorial illustration a fixed size so Lottie stops a constraints loop #3418 is already present. Latest Lottie release remains 4.6.1; upstream perf: list simulators once between device setup and the boot check #2678 was closed unmerged. Broad AppKit/SwiftUI constraint-loop reports exist, but no released fix resolves this local replay event cycle.
Cause
Unknown. The crash stack confirms tutorial viewer-event delivery during NSHostingView.layout. The recreated-current-value-subscription loop is an unconfirmed hypothesis: two isolated hosting probes using the exact source stayed stable through parent/content redraws and pause/resume, emitting one then two Play events. Full tutorial/viewer reproduction is still required before applying a production fix.
Fix idea
First reproduce the full tutorial/viewer interaction and inspect the event sequence during window layout. Any fix must preserve one Play event per actual paused-to-playing transition and normal replay behavior. Verify redraws and pause/resume with an owned Desktop copy; use behavioral coverage rather than source-text assertions.
Activity
janicduplessis commentedon Oct 13, 2026
Claimed: fix/3704-tutorial-replay-loop
janicduplessis commentedon Oct 13, 2026
The crash report confirms tutorial viewer-event delivery during NSHostingView.layout. Two isolated native NSHosting probes using the exact ReplayingContent source remained stable through parent/content redraws and pause/resume (1 then 2 Play events). The repeated-subscription explanation is therefore a hypothesis, not a confirmed cause; no production patch has been applied. Continuing with the full tutorial/viewer interaction in a separate locally owned Desktop copy.
janicduplessis commentedon Oct 26, 2026
Released: stale claim. It was claimed 12.5 days ago, with no open pull request and no later release. Under the issue workflow a claim older than one day doesn't hold, so this issue is free to pick up. The branch
fix/3704-tutorial-replay-loopis still on origin and is kept, since it may hold unfinished work.janicduplessis commentedon Oct 27, 2026
Claimed: fix/3704-tutorial-replay-loop-v2
fix(desktop): deliver tutorial viewer events off the layout pass (#3704)
fix(desktop): deliver tutorial viewer events off the layout pass (app…