Bugzilla – Bug 6949
InfoBrowser applet fails when no players, and when server not connected
Last modified: 2009-09-08 09:13:07 UTC
Hello, Two small problems with the InfoBrowser applet: 1. if there's no player, the applet will connect to the first server in the list. This server isn't necessarily available. Suggest changing this: -------- for _, server in sd:allServers() do self.server = server break end -------- to: -------- for _, server in sd:allServers() do if (server:isConnected()) then self.server = server break end end -------- 2. if there's no player, but valid server is found, the comet requests are still sent with "self.player.id". Suggest changing the comet requests so "self.player.id" is replaced with "nil" or "self.player and self.player.id". (Don't see why a player is necessary for these InfoBrowser requests)
What do you think, Triode?
I suggest for 7.0.1 we make InfoBrowser a SC-only feature, not a Jive applet. It should not appear unless you're connected to a player.
I agree this should be fixed for 7.0 as it can cause a crash Patch is: --- src/share/applets/InfoBrowser/InfoBrowserApplet.lua 2008-02-01 19:58:03.000000000 +0000 +++ applets/InfoBrowser/InfoBrowserApplet.lua 2008-02-05 20:29:05.000000000 +0000 @@ -66,8 +66,10 @@ self.server = self.player:getSlimServer() else for _, server in sd:allServers() do - self.server = server - break + if server:isConnected() then + self.server = server + break + end end end end @@ -90,7 +92,7 @@ self:response(chunk.data, window, widget, list, prevmenu, locked) end end, - self.player.id, + self.player and self.player.id, { 'infobrowser', 'items', start, gulp, index and ("item_id:" .. index) } ) end Note this does not allow Infobrowser to work without a player attached - this appears because the server comet session does not work with no player... I don't see why we need to do this? Dean - do you want the above in 7.0?
Yes, please! Thanks, Triode. -dean
patch added as r1822 Keeping bug open to look at SC only version suggested by Andy
Making InfoBrowser SC only should be a 7.1 fix.
Actually I'd prefer to have a mechanism in 7.1 to allow an applet to be removed from the menu if the current server does not support it (e.g. its SN). This would allow other applets such as the network test one to be included and not show up with SN - which I believe is at the root of Andy's requirement? Otherwise we are going to push for all addons to be SC plugins rather than applets so they don't show up with SN...
Triode: do you think that this should be a 7.0.1 addition?
If 7.0.1 is going to live for any significant time and you want people to add applets then yes I tend to think so..
It will and I do. Patches?
Looks like we can already make an applet appear in the menu conditional on which server is connected - does this seem the right thing to do? function registerApplet(meta) jnt:subscribe(meta) meta.menu = meta:menuItem('appletNetTest', 'advancedSettings', meta:string('NETTEST'), function(applet, ...) applet:open(...) end, 10) jiveMain:loadSkin("NetTest", "skin") end function notify_playerCurrent(meta, player) if player == nil or player.slimServer.name == 'SqueezeNetwork' then jiveMain:removeItem(meta.menu) else jiveMain:addItem(meta.menu) end end
That looks good, small change: player.slimServer.name == 'SqueezeNetwork' should be: player.slimServer.isSqueezeNetwork() If we find that lots of applets need this then we probably should push this into the Home menu api.
change 2104 - detect lack of player and remove from the menu I prefer this to making infobrowser a SC plugin so consider this fixed...
Good work - thanks chaps :-) Matthew
Closing bug in 7.0.1