Repository navigation
Remove dead duplicate VLCClientFactory.clientConnectionLost - #819
harshdeepsinghin wants to merge 1 commit into
Conversation
VLCClientFactory defined clientConnectionLost twice. The second definition - the VLC-specific implementation that reconnects while within VLC_OPEN_MAX_WAIT_TIME or otherwise drops the player - silently shadowed the first one, which only logged the loss and delegated to ReconnectingClientFactory.clientConnectionLost. The delegating version was therefore unreachable dead code. Remove the unreachable definition so the class has a single, unambiguous clientConnectionLost. This does not change runtime behaviour because the removed method could never be called. The delegating clientConnectionFailed added alongside it is unaffected and remains in use.
|
Hi, thanks for your contribution. While I'm responsible for the VLC implementation, I don't actually use VLC on a day-to-day basis. Your suggested change looks correct to me, as it should not alter the existing behaviour. Have you tested it with VLC, particularly that it connects normally and that closing VLC still causes Syncplay to shut down as expected? |
|
Full transparency: I originally filed this PR because I experienced VLC closing repeatedly, but I can no longer reproduce that issue on either master or the fix branch - both work identically now. Tested both:
Since the removed method was dead code (overridden by the second definition), this PR safely cleans up the duplicate without changing runtime behavior. The code is clearer now. Ready to merge if you agree. |
VLCClientFactorydefinesclientConnectionLosttwice:ReconnectingClientFactory.clientConnectionLost;VLC_OPEN_MAX_WAIT_TIMEand otherwise drops the player.Because Python keeps the last definition, the second one wins, so the first was unreachable dead code — meaning the 2021 change never actually took effect for lost connections.
This removes the unreachable definition so the class has a single, unambiguous
clientConnectionLost. Runtime behaviour is unchanged, since the removed method could never be called. The delegatingclientConnectionFailedadded in the same commit is unaffected and still in use.If the intent in 9b90dd5 was in fact to replace the older implementation with the delegating one, then the fix should go the other way (remove the second definition instead) — happy to adjust.