Addresses https://github.com/bboozzoo/mconnect/issues/53 #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This prevents the server from crashing when the mpris plugin tries to talk to devices that aren't (yet) connected.
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.