Skip to content

Fix the app hanging on Connect to Server - #23

Merged
epell-development merged 1 commit into
mainfrom
claude/project-thread-nsi2gd
Oct 26, 2026
Merged

epell-development merged 1 commit into
mainfrom
claude/project-thread-nsi2gd

Conversation

@epell-development

Copy link
Copy Markdown
Owner

Requested by epell · project thread

What broke

In v0.2.9 the desktop app freezes ("crashes") as soon as it connects to a server, while the server logs a normal sign-in.

Link::start gained s.core.lock().set_wave_source(..) (track editor waveforms from the server, #21). The app calls connect → Link::start from the UI thread with the playout already locked (app.rs, the arc.lock() before server_windows / remote_sign_in). parking_lot::Mutex isn't re-entrant, so the UI thread deadlocks on itself. The existing server tests call Link::start without holding the lock, so they didn't catch it.

Fix

  • Playout::set_wave_source(tx) → Playout::wave_requests() -> Receiver<PathBuf>; connect calls it on the mirror before the swap.
  • Link::start takes the waves receiver and never locks core (documented).
  • Same re-lock in the server file picker (server_picker_window did self.core.lock() under server_windows, so opening a file dialog while connected would also hang): it now reads the library folders from the core it's given.

Test

server::tests::connecting_with_the_playout_locked connects exactly like the app (lock held, mirror_of, swap, Link::start) and fails within 10 s if it hangs. Verified it fails on the old code and passes now.

cargo fmt, cargo +1.99.0 clippy --all-targets -- -D warnings, cargo test (both binaries) all pass.

CHANGELOG (for v0.2.10)

Fixed

  • The app froze when connecting to a RadioMaster Server (v0.2.9), and when opening a file dialog while connected.

Generated by Claude Code

v0.2.9's Link::start locked the playout to hand it the waveform channel,
but the app calls it from the UI thread with that lock already held, so
connecting deadlocked the app (the server saw a normal sign-in). The
mirror now gets its wave channel from Playout::wave_requests before the
swap, and Link::start takes the receiver without locking.

The server file picker had the same re-lock while connected; it now
reads the library folders from the playout it is given.

Adds a test that connects with the playout locked, as the app does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0121MtpepbszTWK1oCTggoPk
@epell-development epell-development self-assigned this Oct 26, 2026

@mergeguards mergeguards Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MergeGuard review
Risk: 🔴 60/100 — risky
Findings: 🔴 1 high
Open Files changed for 1 inline review thread on the diff.

💡 Use the Fix All MergeGuard Findings checkbox comment on this PR to apply auto-fixes in batch, or reply @mergeguards fix on any inline finding.

⚠️ This PR may benefit from a deep scan — consider triggering @mergeguards deep-scan.


Reviewed by MergeGuard AI

Comment thread src/link.rs
@mergeguards

mergeguards Bot commented Oct 26, 2026

Copy link
Copy Markdown

MergeGuard agent actions

Fix all findings

All issues (1)
  • high · src/link.rs:268 — New parameter waves: Receiver<std::path::PathBuf> added to Link::start signature. All call sites must be updated to pass this parameter. Existing tests and production code that call `Link::star…

Apply auto-fixes for the findings above on this branch:

  • Fix All MergeGuard Findings

Or reply with @mergeguards fix-all on this pull request.

@epell-development
epell-development merged commit 35e0737 into main Oct 26, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants