mconnect
mconnect copied to clipboard
Crash when paired with multiple devices
I'm running mconnect and I have it paired with multiple devices.
Steps to reproduce:
- Run mconnect
- Pair with Device A
- Pair with Device B
- So far, everything works
- Restart the mconnect daemon
- It crashes soon after startup
It looks like the reason for this is the MPRIS plugin. When the daemon starts, it connects to one device, which immediately sends it a kde.mpris.request packet. mconnect responds by sending a kde.mpris packet to all connected devices, including the one that isn't connected yet.
@flyingpimonster @grimpy I'm going to submit a PR to address this.
On the one hand, server processes should be as robust as possible and try to recover; in that spirit, my patch prevents the server from segfaulting when a device isn't present. However, the root cause -- that the mpris plugin may be incorrectly propegating messages -- is not addressed. On the other-other hand, I don't know if it shouldn't be propegating messages; probably, the bestest, correctest fix would be to make mconnect smart enough to not try to send messages to devices that aren't connected, whether or not plugins ask for it, but that's a much bigger change. And, as I initially stated, philisophically, having servers that recover gracefully when they encounter error states is preferable, so this is at least a necessary, if not sufficient, fix.
I'ma copy/paste this is the PR, which will probably be ignored anyway.
@xxxserxxx thx for letting me know I applied it to my fork ;-)