WhoLib

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

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 :)

User When Change
sylvanaar Mon, 03 Aug 2009 00:09:26 Changed status from Started to Waiting
sylvanaar Fri, 24 Jul 2009 14:50:25 Changed status from New to Started
sylvanaar Fri, 24 Jul 2009 14:50:09 Changed assigned to from akazik to sylvanaar
Casam Mon, 04 May 2009 05:04:22 Create

You must login to post a comment. Don't have an account? Register to get one!

  • 2 comments
  • Avatar of sylvanaar sylvanaar Mon, 03 Aug 2009 00:09:19

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

  • Avatar of sylvanaar sylvanaar Mon, 03 Aug 2009 00:08:06

    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

  • 2 comments

Facts

Last updated on
03 Aug 2009
Reported on
04 May 2009
Status
Waiting - Waiting for more information.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.

Reported by

Possible assignees