Difegue / Stylophone

A pretty cool™️ MPD client in .NET. Based on MpcNET.
https://tvc-16.science/stylophone-27.html
MIT License
135 stars 10 forks source link

Connecting on another mpd instance after being already connected #43

Closed ZetaKebab closed 2 years ago

ZetaKebab commented 2 years ago

Hi! There's an issue I encountered on Stylophone: if I try to connect to another mpd instance after being already connected to another one, strange behaviours will happen:

I've looked a bit around, it seems to be InitializeStatusUpdater function that doesn't get properly cancelled. This break gets called a bit late:

if (token.IsCancellationRequested || _idleConnection == null)
      break;

I've not checked if this is due to how it is done within MpcNET, but it seems disconnecting causes issues. Honestly, it's not a user behaviour I would expect to be really common, but I'd thought I'd let you know this minor issue exists.

Difegue commented 2 years ago

Thanks for this report -- I admittedly haven't tested dual mpd instances much since that's not something I do personally, so it's likely the disconnecting logic doesn't clean up well enough. 😅

Making the connectionservice more robust would also help with https://github.com/Difegue/Stylophone/issues/22 whenever I find the motivation to do it. 🤠

Difegue commented 2 years ago

Fixed by https://github.com/Difegue/Stylophone/pull/56/commits/7d831d834ee44875ce0c144b6764dd9b1ed8e127 while I was working out kinks in the iOS port -- Should be much better now!