Error on Reload/Logout
Dairyman opened this issue ยท 5 comments
When reloading or on logout in a zone where the addon is active:
1x ...dOns\RareTrackerCore\RareTrackerCoreEventHandler.lua:468: attempt to index field 'previous_records' (a nil value)
[string "@RareTrackerCore\RareTrackerCoreEventHandler.lua"]:468: in function `OnPlayerLogout'
[string "@RareTrackerCore\RareTrackerCoreEventHandler.lua"]:81: in function `OnEvent'
[string "@RareTrackerCore\RareTrackerCoreEventHandler.lua"]:517: in function <...dOns\RareTrackerCore\RareTrackerCoreEventHandler.lua:516>
Locals:
self = RTN {
0 = <userdata>
defaults = <table> {
}
InitializeAnnounceIconFrame = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:503
is_loaded = true
OnCombatLogEvent = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:254
OnUnitHealth = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:204
CloseInterface = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:87
OnChatMessageReceived = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:601
completion_quest_ids = <table> {
}
last_recorded_death = <table> {
}
GetCompressedSpawnData = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:119
ChangeShard = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:108
OnZoneTransition = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:91
OnChatMsgAddon = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:358
RegisterPresenceWhisper = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:234
OnChatMsgMonsterYell = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:340
target_zones = <table> {
}
arrival_register_time = 1581610939
InitializeRareTrackerDatabase = <function> defined @RareTrackerNazjatar\RareTrackerNazjatarOptions.lua:12
rare_names = <table> {
}
UpdateShardNumber = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:413
rare_display_names = <table> {
}
rare_ids = <table> {
}
InitializeShardNumberFrame = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:119
InitializeReloadButton = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:563
RegisterPresenceGroup = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:249
broadcast_icon = RTN.broadcast_icon {
}
UnregisterEvents = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:489
db = <table> {
}
addon_code = "RTN"
texture = <unnamed> {
}
channel_name = "RTN4039"
RegisterEvents = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:477
CreateRareTableEntry = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:142
RegisterEntityDeath = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:335
last_zone_id = 1355
current_shard_id = "4039"
AcknowledgeArrival = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:298
reported_spawn_uids = <table> {
}
waypoints = <table> {
}
UpdateStatus = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:387
RegisterArrival = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:168
completion_quest_inverse = <table> {
}
RegisterDeparture = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:264
InitializeCloseButton = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:639
InitializeRareTableFrame = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:355
CorrectFavoriteMarks = <function> defined @RareTrackerCore\RareTrackerCoreInterface.lua:424
CheckForRedirectedRareIds = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:152
rare_table_updated = false
AcknowledgeEntityAlive = <function> defined @RareTrackerCore\RareTrackerCoreCommunication.lua:535
OnUpdate = <function> defined @RareTrackerCore\RareTrackerCoreEventHandler.lua:379
close_button = RTN.close_button {
}
current_health = <table> {
}
reported_vignettes = <table> {
}
AddModuleOptions = <function> defined @A
Curious. It would seem that this addon can only be seen when using addons like BugSack/BugGrabber. I am not sure why the error is thrown, since the associated code still seems to work correctly. I will look into this issue further soon.
It would seem that something went wrong during the core library rewrite I did a while ago, causing all rare kill information to not be saved correctly during reloads/logouts. I will have a fix ready later today.
Can it be that AceDB's logout handler is called first and that is why it is nil?
To be sure you are called first, you could use the OnDatabaseShutdown
callback.
Ah, I think you are right--the callback function does indeed sound like a better solution. I will implement it later today or tomorrow if time permits.