UserInfo runs the callback with 'nil' instead of the documented behavior for offline users. #8


  • Defect
  • Waiting
Open
Assigned to sylvanaar
  • _ForgeUser2509592 created this issue May 4, 2009
    What steps will reproduce the problem? 1. Embed the library per the documentation. 2. Call self:UserInfo('SomeoneNotOnline', {callback='handleUserData'}) 3. handleUserData will get called with nil as the first parameter. What is the expected output? What do you see instead? I'm expecting something along the lines of { Name='SomeoneNotOnline', Online=false } What version of the product are you using? 2.0-2.0.2 Do you have an error log of what happened? Not one that's very useful. Please provide any additional information below. This patch fixes the bug:
    --- LibWho-2.0.lua.orig      2009-04-14 12:40:18.000000000 -0400
    +++ LibWho-2.0.lua 2009-05-04 00:47:31.000000000 -0400
    @@ -178,7 +178,7 @@
                                    self:RaiseCallback(args, self.Cache[args.name].data)
                                    return false
                            else
    -                               return self:DupAll(self:ReturnUserInfo(name))
    +                               return self:DupAll(self:ReturnUserInfo(args.name))
                            end
                    elseif(self.Cache[args.name].valid == false)then
                            -- query is already running (first try)
    @@ -426,7 +426,7 @@
                    end
                    dbg('Info(' .. name ..') returned: ' .. (self.Cache[name].data.Online == false and 'off' or 'unkn'))
                    for _,v in pairs(self.Cache[name].callback) do
    -                       self:RaiseCallback(v, self:ReturnUserInfo(v.Name))
    +                       self:RaiseCallback(v, self:ReturnUserInfo(v.name))
                    end
                    self.Cache[name].callback = {}
                    self.CacheQueue[self.Args.query] = nil
    
    Thanks for a great library, by the way. It has saved me a lot of time :)
  • _ForgeUser2509592 added the tags New Defect May 4, 2009
  • sylvanaar unassigned issue from Forge_User_65927410 Jul 24, 2009
  • sylvanaar self-assigned this issue Jul 24, 2009
  • sylvanaar removed a tag New Jul 24, 2009
  • sylvanaar added a tag Started Jul 24, 2009
  • sylvanaar posted a comment Aug 2, 2009

    Revision: 90 Author: sylvanaar Date: 8:07:32 PM, Sunday, August 02, 2009 Message: Part of the suggested fix for #8. The fix for the missing table reference was added, but the case change for v.Name still needs clarification


    Modified : /trunk/LibWho-2.0/LibWho-2.0.lua

  • sylvanaar posted a comment Aug 2, 2009

    The code has changed a bit. Could you review this issue, and the change I made to correct it?

  • sylvanaar removed a tag Started Aug 2, 2009
  • sylvanaar added a tag Waiting Aug 2, 2009

To post a comment, please login or register a new account.