Bug 5621 - Default skin player chooser resets on server restart
: Default skin player chooser resets on server restart
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 7.0
: Macintosh Other
: P2 normal (vote)
: ---
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-09-29 17:12 UTC by KDF
Modified: 2009-09-08 09:15 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
patch I've been using (1.04 KB, patch)
2007-11-05 09:53 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description KDF 2007-09-29 17:12:39 UTC
The Javascript for updating current player will reset to blank when the server is gone.  This ends up causing the wrong wrong player to be used after a server restart. This doesn't seem to affect the current playlist, but it does affect the browse and now playing sections. Michael has not yet been able to duplicate, but I'm getting it all of the time.  I'm gooiing to leave this here as placeholder in case I do find a fix.
Comment 1 KDF 2007-09-30 23:28:45 UTC
the cause is the following lines:

PlyerChooser.selectPlayer({
	text: '',
	value: ''
});

This causes the cookie to be set to '', thus when the server starts up, it will default back to the first player in the list.  It makes sense to be able to react to a player that goes away, but we probably need a way to also have the "preferred player" kept around.  Maybe a dual cookie system "last-select" and "current player", with teh preference for teh "last-selected".  I also have another idea for the player cookie which I'll post as a new enahancement.
Comment 2 KDF 2007-11-05 09:53:12 UTC
Created attachment 2357 [details]
patch I've been using

This is probably not the correct solution, as you may want to have some mechanism for dealing with players that have really gone away.  I've been using this patch becuase I don't add/remove players so I can count on a given player being in the list within a few seconds.  Both cases cause problems as they can be executed before all players have initialised. I still think a more thorough solution would be one that bypassed the cookie player if it's not in the list, but only writing a new value to the cookie when a player is manually chosen.  Unfortunately, it hasn't been something I've had much time to work on.
Comment 3 Michael Herger 2007-11-07 13:06:46 UTC
change 14477 - trying to keep the current player until the user selects a new one. This should help with conditions where the server is coming back but doesn't know all player's yet.
Comment 4 Michael Herger 2007-11-12 08:00:07 UTC
Kevin - can you still reproduce this issue?
Comment 5 KDF 2007-11-12 10:55:02 UTC
On restart, the chooser goes blank, which matches what you described in the checkin.  However, it doesn't seem to recover when the player is back. refreshing the window correct gets the previously chosen player, so that's the main thing.  Ideally, then the jsonrpc.js returns start up again, the chooser should recover if the player cookie is in the list.
Comment 6 Michael Herger 2007-11-14 08:33:35 UTC
Change 14701 is another try to sort this out... 
Comment 7 KDF 2007-11-14 17:53:53 UTC
seems to be working fine now.
Comment 8 Michael Herger 2007-12-27 08:25:39 UTC
We're seeing side-effects of this change which lead to continued loading of the browse frame:

Dean: shut down SC and switch from eg. to trunk, while a browser window is still open

Michael: open SC web interface, disconnect currently selected player, restart SC

Interestingly the issue doesn't occur in FF, as it doesn't call the failure handler but just passes an empty answer to the success handler when querying the player status fails. Other browsers like eg. Safari will loop quickly.
Comment 9 Michael Herger 2007-12-27 09:08:10 UTC
Change 15641 clears the global playerid variable, but tries to keep track of the last used player. If it comes back it will automatically be selected again.

Could you please test this with your cases of looping Safari (Dean) and wrongly connected players (Kevin)? Thanks!
Comment 10 KDF 2008-01-01 21:24:11 UTC
seems ok for keeping the player across restart, at least for me.
Comment 11 Michael Herger 2008-01-03 01:27:26 UTC
Thanks for the feedback. Everybody feel free to re-open if needed.
Comment 12 Chris Owens 2008-03-07 09:04:18 UTC
This bug is being closed since it was resolved for a version which is now released!  Please download the new version of SqueezeCenter (formerly SlimServer) at http://www.slimdevices.com/su_downloads.html

If you are still seeing this bug, please re-open it and we will consider it for a future release.