Bagnon

Bagnon

126M Downloads

Constant LUA Error, pops up every 30 seconds..

MisterNegative opened this issue · 4 comments

commented

have lastest version installed through curseforge and I get this LUA Error every 30 seconds non stop.

image

Message: Interface/AddOns/BagBrother/core/api/owners.lua:75: invalid order function for sorting
Time: Sat Sep 2 11:43:15 2023
Count: 1
Stack: Interface/AddOns/BagBrother/core/api/owners.lua:75: invalid order function for sorting
[string "=[C]"]: in function sort' [string "@Interface/AddOns/BagBrother/core/api/owners.lua"]:75: in function Sort'
[string "@Interface/AddOns/BagBrother/core/api/owners.lua"]:66: in function ?' [string "@Interface/AddOns/BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...her/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119> [string "=[C]"]: ? [string "@Interface/AddOns/BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...her/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25> [string "@Interface/AddOns/BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function Fire'
[string "@Interface/AddOns/BagBrother/libs/AceEvent-3.0/AceEvent-3.0.lua"]:120: in function <...AddOns/BagBrother/libs/AceEvent-3.0/AceEvent-3.0.lua:119>

Locals: (*temporary) =

{
1 =
{
}
2 =
{
}
3 =
{
}
4 =
{
}
5 =
{
}
6 =
{
}
7 =
{
}
8 =
{
}
9 =
{
}
10 =
{
}
11 =
{
}
12 =
{
}
13 =
{
}
14 =
{
}
15 =
{
}
16 =
{
}
17 =
{
}
18 =
{
}
19 =
{
}
20 =
{
}
21 =
{
}
22 =
{
}
23 =
{
}
24 =
{
}
25 =
{
}
26 =
{
}
27 =
{
}
28 =
{
}
29 =
{
}
30 =
{
}
31 =
{
}
32 =
{
}
33 =
{
}
34 =
{
}
35 =
{
}
36 =
{
}
37 =
{
}
38 =
{
}
39 =
{
}
40 =
{
}
}
(*temporary) = defined @Interface/AddOns/BagBrother/core/api/owners.lua:75
(temporary) =
{
profile =
{
}
isguild = 16
name = "Death and Glory"
address = "®Death and Glory-Silvermoon"
id = "Death and Glory
"
offline = true
cache =
{
}
realm = "Silvermoon"
}
(temporary) =
{
profile =
{
}
isguild = 16
name = "Death and Glory"
address = "®Death and Glory-Silvermoon"
id = "Death and Glory
"
offline = true
cache =
{
}
realm = "Silvermoon"
}
(temporary) =
{
profile =
{
}
isguild = 9
name = "Entropia"
address = "®Entropia-Silvermoon"
id = "Entropia
"
offline = true
cache =
{
}
realm = "Silvermoon"
}

commented

There seems to be something about the isguild conditional that lua doesn't like. im not familiar enough with lua sort or this addon to know why. Just randomly guessing, maybe the sort function expects to see only nil or 1 as return values, and b.isguild doesn't have to be nil or 1, but I'm not sure.

You can remove the isguild conditional entirely and the error goes away.

I replaced the sort function with this and it also seems to go away. This is testing that neither isguild is nil, and then that they are not equal, to be sure we are comparing two numbers against eachother, then using the < operator to compare them.

        sort(self.ordered, function(a, b)
		if (a.isguild and b.isguild) and a.isguild ~= b.isguild then
			return a.isguild < b.isguild
		elseif a.level == b.level or not (a.level and b.level) then
			return a.name < b.name
		end
		return a.level > b.level
	end)

I don't have time to do a pull request right now, but i'll try to get around to it if nobody else picks this up and patches.

commented

There seems to be something about the isguild conditional that lua doesn't like. im not familiar enough with lua sort or this addon to know why. Just randomly guessing, maybe the sort function expects to see only nil or 1 as return values, and b.isguild doesn't have to be nil or 1, but I'm not sure.

You can remove the isguild conditional entirely and the error goes away.

I replaced the sort function with this and it also seems to go away. This is testing that neither isguild is nil, and then that they are not equal, to be sure we are comparing two numbers against eachother, then using the < operator to compare them.

        sort(self.ordered, function(a, b)
		if (a.isguild and b.isguild) and a.isguild ~= b.isguild then
			return a.isguild < b.isguild
		elseif a.level == b.level or not (a.level and b.level) then
			return a.name < b.name
		end
		return a.level > b.level
	end)

I don't have time to do a pull request right now, but i'll try to get around to it if nobody else picks this up and patches.

That's already a big help in figuring out the cause, narrowing it down to the guild part. I'll fix this quickly now.

commented

Ah. isguild is suppose to be a boolean, but because I'm an idiot it's an integer. Fixed in upcoming version I believe.

commented

Error still the same after updating to latest version...

Message: Interface/AddOns/BagBrother/core/api/owners.lua:75: invalid order function for sorting
Time: Sat Sep 9 13:53:58 2023
Count: 11
Stack: Interface/AddOns/BagBrother/core/api/owners.lua:75: invalid order function for sorting
[string "=[C]"]: in function sort' [string "@Interface/AddOns/BagBrother/core/api/owners.lua"]:75: in function Sort'
[string "@Interface/AddOns/BagBrother/core/api/owners.lua"]:66: in function ?' [string "@Interface/AddOns/BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...her/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119> [string "=[C]"]: ? [string "@Interface/AddOns/BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...her/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25> [string "@Interface/AddOns/BagBrother/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function Fire'
[string "@Interface/AddOns/BagBrother/libs/AceEvent-3.0/AceEvent-3.0.lua"]:120: in function <...AddOns/BagBrother/libs/AceEvent-3.0/AceEvent-3.0.lua:119>

Locals: (*temporary) =

{
1 =
{
}
2 =
{
}
3 =
{
}
4 =
{
}
5 =
{
}
6 =
{
}
7 =
{
}
8 =
{
}
9 =
{
}
10 =
{
}
11 =
{
}
12 =
{
}
13 =
{
}
14 =
{
}
15 =
{
}
16 =
{
}
17 =
{
}
18 =
{
}
19 =
{
}
20 =
{
}
21 =
{
}
22 =
{
}
23 =
{
}
24 =
{
}
25 =
{
}
26 =
{
}
27 =
{
}
28 =
{
}
29 =
{
}
30 =
{
}
31 =
{
}
32 =
{
}
33 =
{
}
34 =
{
}
35 =
{
}
36 =
{
}
37 =
{
}
38 =
{
}
39 =
{
}
40 =
{
}
41 =
{
}
}
(*temporary) = defined @Interface/AddOns/BagBrother/core/api/owners.lua:75
(temporary) =
{
isguild = 16
cache =
{
}
id = "Death and Glory
"
profile =
{
}
name = "Death and Glory"
address = "®Death and Glory-Silvermoon"
offline = true
counts =
{
}
realm = "Silvermoon"
}
(temporary) =
{
isguild = 16
cache =
{
}
id = "Death and Glory
"
profile =
{
}
name = "Death and Glory"
address = "®Death and Glory-Silvermoon"
offline = true
counts =
{
}
realm = "Silvermoon"
}
(temporary) =
{
isguild = 13
cache =
{
}
id = "Pub Crawlers
"
profile =
{
}
name = "Pub Crawlers"
address = "®Pub Crawlers-Silvermoon"
offline = true
counts =
{
}
realm = "Silvermoon"
}