Bagnon

Bagnon

122M Downloads

Classic: Bagnon+PitBull4 trigger ADDON_LOADED event early

shururuun opened this issue · 2 comments

commented

Running Software:

  • Addon version: 8.2.29
  • Server patch: Classic 1.13.3 (32836)

Have you read the changelog?
Yes

Describe the bug
Installing Bagnon and PitBull4 at the same time throws off PitBull4 by triggering the ADDON_LOADED event early before it has instanced AceDB to load its config into PitBull4.db.

To Reproduce
Steps to reproduce the behaviour:

  1. Install Bagnon
  2. Install PitBull4
  3. Login
  4. See error

Expected behaviour
No error

Error Logs
Date: 2020-01-13 21:00:19
ID: 1
Error occured in: Global
Count: 1
Message: ..\AddOns\PitBull4\ModuleHandling\Module.lua line 120:
attempt to index field 'db' (a nil value)
Debug:
PitBull4\ModuleHandling\Module.lua:120:
PitBull4\ModuleHandling\Module.lua:99
[C]: ?
...nts\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:29:
...nts\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25
...nts\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:64: Fire()
...\common\Wildpants\libs\AceEvent-3.0\AceEvent-3.0.lua:120:
...\common\Wildpants\libs\AceEvent-3.0\AceEvent-3.0.lua:119
Locals:
None
AddOns:
Swatter, v8.2.6377 (SwimmingSeadragon)
Bagnon, v8.2.29
PitBull4, vv4.1-classic18
BlizRuntimeLib_enUS v1.13.3.11303
(ck=82)

Additional context

  1. It works fine with Bagnon 8.2.12

  2. It works fine if you comment out line 63 in Bagnon\common\Wildpants\libs\WildAddon-1.0\WildAddon-1.0.lua:

Events.RegisterEvent(Lib, 'PLAYER_LOGIN', load)
-- Events.RegisterEvent(Lib, 'ADDON_LOADED', load)```

commented

I also get multiple similar errors last few days:

Here's one:

Message: Interface\AddOns\FlashTaskBar\FlashTaskBar.lua:597: table index is nil
Time: Sat Jan 18 22:11:11 2020
Count: 23
Stack: Interface\AddOns\FlashTaskBar\FlashTaskBar.lua:597: table index is nil
[string "@interface\AddOns\FlashTaskBar\FlashTaskBar.lua"]:597: in function <Interface\AddOns\FlashTaskBar\FlashTaskBar.lua:583>
[string "=[C]"]: ?
[string "@interface\AddOns\Bagnon\common\Wildpants\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"]:29: in function <...nts\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
[string "@interface\AddOns\Bagnon\common\Wildpants\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"]:64: in function `Fire'
[string "@interface\AddOns\Bagnon\common\Wildpants\libs\AceEvent-3.0\AceEvent-3.0.lua"]:120: in function <...\common\Wildpants\libs\AceEvent-3.0\AceEvent-3.0.lua:119>

Locals:

Here's another one:

Message: Interface\AddOns\PitBull4\Modules\Aggro\Aggro.lua:44: attempt to index field 'db' (a nil value)
Time: Sat Jan 18 22:10:16 2020
Count: 1
Stack: Interface\AddOns\PitBull4\Modules\Aggro\Aggro.lua:44: attempt to index field 'db' (a nil value)
[string "@interface\AddOns\PitBull4\Modules\Aggro\Aggro.lua"]:44: in function ?' [string "@interface\AddOns\PitBull4\Main.lua"]:1037: in function CallMethodOnModules'
[string "@interface\AddOns\PitBull4\ModuleHandling\Module.lua"]:112: in function <Interface\AddOns\PitBull4\ModuleHandling\Module.lua:98>
[string "=[C]"]: ?
[string "@interface\AddOns\Bagnon\common\Wildpants\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"]:29: in function <...nts\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
[string "@interface\AddOns\Bagnon\common\Wildpants\libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"]:64: in function `Fire'
[string "@interface\AddOns\Bagnon\common\Wildpants\libs\AceEvent-3.0\AceEvent-3.0.lua"]:120: in function <...\common\Wildpants\libs\AceEvent-3.0\AceEvent-3.0.lua:119>

Locals:

The same problem was also reported in 1154.

commented

Pitbull is at fault here (and FlashTaskBar apparently too): they are misusing the AceEvent-3.0 library and also poorly handling the ADDON_LOADED event. The only reason the error appears to show in Bagnon its because it loads AceEvent-3.0 before and also listens to ADDON_LOADED.

I even fixed Pitbull's code by replacing lines 99 and 100:

LibStub("AceEvent-3.0").RegisterEvent({}, "ADDON_LOADED", function(event, addon)
	if not PitBull4.Options or not PitBull4.Options.HandleModuleLoad or not IsLoggedIn() then

Unfortunately you need to report this issue with the developers of those mods, not me.

⚠️ Any future duplicated issues reported on this topic will be closed without explanation, don't have time to deal with this.