valkyrnstudios / RankSentinel

MIT License
4 stars 2 forks source link

Pets group units cause errors #53

Closed Road-block closed 2 years ago

Road-block commented 2 years ago
6x RankSentinel\Utilities.lua:102: attempt to index field 'petOwnerCache' (a nil value)
[string "@RankSentinel\Utilities.lua"]:102: in function <RankSentinel\Utilities.lua:97>
[string "=(tail call)"]: ?
[string "@RankSentinel\RankSentinel-264371b.lua"]:114: in function `?'
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:119: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:29: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:64: in function `Fire'
[string "@Ace3\AceEvent-3.0\AceEvent-3.0-4.lua"]:120: in function <Ace3\AceEvent-3.0\AceEvent-3.0.lua:119>
Road-block commented 2 years ago

I lied, happens inside instances too, I am in one right now sorry for the barebones report (latest alpha)

SabreValkyrn commented 2 years ago

Ah, thanks. Looking into it.

I didn't test out pets after major overhaul and flavor additions last night.

SabreValkyrn commented 2 years ago

Huh, looks like it was never part of the database initialization, I just had enough logic surrounding petOwnerCache to add it later on with UpgradeProfile and ClearCache.

Should be fixed with 9d3ab6d

Road-block commented 2 years ago
12x SendChatMessage(): Invalid escape code in chat message
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@RankSentinel\Cache.lua"]:40: in function `ProcessQueuedNotifications'
[string "@RankSentinel\Cache.lua"]:60: in function `QueueNotification'
[string "@RankSentinel\RankSentinel-264371b.lua"]:145: in function `?'

as well with the same alpha (haven't updated yet)

SabreValkyrn commented 2 years ago

That error shows up when the |TInterface\\TargetingFrame\\UI-RaidTargetingIcon_7.blp:0|t string (from Self) shows up in a Whisper notification, hopefully it's handled by fixed petOwnerCache lookup so the proper contactName is evaluated.

Road-block commented 2 years ago

Latest alpha didn't fix the SendAddonMessage error.

62x SendChatMessage(): Invalid escape code in chat message
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@RankSentinel\Cache.lua"]:40: in function `ProcessQueuedNotifications'
[string "@RankSentinel\Cache.lua"]:60: in function `QueueNotification'
[string "@RankSentinel\RankSentinel-264371b.lua"]:145: in function `?'
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:119: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:29: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:64: in function `Fire'
[string "@Ace3\AceEvent-3.0\AceEvent-3.0-4.lua"]:120: in function <Ace3\AceEvent-3.0\AceEvent-3.0.lua:119>
Road-block commented 2 years ago

Hmm, actually not sure, I'm raiding atm and I might not have reloaded :/

SabreValkyrn commented 2 years ago

Looks like it is the same version both times, RankSentinel-264371b.lua

Will wait and see if reload works/ed. I also raid tonight so should get testing time in as well.

Road-block commented 2 years ago

I definitely have the latest alpha, I manually downloaded from curseforge and overwrote.

84x SendChatMessage(): Invalid escape code in chat message
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@RankSentinel\Cache.lua"]:40: in function `ProcessQueuedNotifications'
[string "@RankSentinel\Cache.lua"]:60: in function `QueueNotification'
[string "@RankSentinel\RankSentinel-264371b.lua"]:145: in function `?'
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:119: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:29: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:64: in function `Fire'
[string "@Ace3\AceEvent-3.0\AceEvent-3.0-4.lua"]:120: in function <Ace3\AceEvent-3.0\AceEvent-3.0.lua:119>

Edit: Might be a packager issue, I downloaded from here and overwrote and it seems to have cleared it up.

Edit2: It's definitely happening with 46daf22

127x SendChatMessage(): Invalid escape code in chat message
[string "=[C]"]: ?
[string "=[C]"]: ?
[string "@RankSentinel\Cache.lua"]:40: in function `ProcessQueuedNotifications'
[string "@RankSentinel\Cache.lua"]:60: in function `QueueNotification'
[string "@RankSentinel\RankSentinel-264371b.lua"]:145: in function `?'
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:119: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:29: in function <...Ons\Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
[string "@Ace3\CallbackHandler-1.0\CallbackHandler-1.0-7.lua"]:64: in function `Fire'
[string "@Ace3\AceEvent-3.0\AceEvent-3.0-4.lua"]:120: in function <Ace3\AceEvent-3.0\AceEvent-3.0.lua:119>

I know the callstack has the same number but I 100% installed from the master 😊

SabreValkyrn commented 2 years ago

I'm not able to repro myself, unless I'm not lead.

I tweaked a few things, but still trying to work out non-lead notification output.

Road-block commented 2 years ago

I'll try to debug it myself when I get a chance. Essentially I'm going to cache the text it's trying to send, pcall the function and dump the cached string if SendChatMessage errors to see what causes the problem ..

Road-block commented 2 years ago

I do have another question.
Where's the check done that whisper option is enabled? I see Cache.lua#L27 sending to whisper unconditionally.
Should that be the case?

SabreValkyrn commented 2 years ago

https://github.com/valkyrnstudios/RankSentinel/blob/46daf22d774d7369cfe13892bbddc144b73bd404/Cache.lua#L35-L43

Should print if you're the one with a low rank. Print simplified message if you're not lead. Then whisper only if it's not you and you're lead.

Road-block commented 2 years ago

That's the part that errors (which will need a fix regardless, after the issue is found) but that's not really intuitive.

I mean me having toggled /ranksentinel whisper to false and the addon still trying to whisper other players.
I'll probably often be lead by default when I'm the only player with the addon in my group.
What's the intent of the whisper option then? 😄

SabreValkyrn commented 2 years ago

I completely misunderstood what you were saying earlier. Now I follow and 🤦 . 3f907e7

I locally hacked up https://github.com/valkyrnstudios/RankSentinel/blob/3f907e73156103312d1752b5ad1ed2201ee5bef1/RankSentinel.lua#L46-L47

to

    self.playerGUID = UnitGUID("Player") .. 'a'
    self.playerName = UnitName("Player") .. 'a'

then commented this out. https://github.com/valkyrnstudios/RankSentinel/blob/3f907e73156103312d1752b5ad1ed2201ee5bef1/RankSentinel.lua#L113

Was able to send myself whispers without issue.

If you did have whisper disabled, I think that does explains your errors coupled with the now-fixed (3f907e7) whisper bug.

https://github.com/valkyrnstudios/RankSentinel/blob/3f907e73156103312d1752b5ad1ed2201ee5bef1/Utilities.lua#L34-L40 was building a self post message, then ProcessQueuedNotifications wasn't obeying that setting so sent a self-formatted message as a whisper.

SabreValkyrn commented 2 years ago

Without reloading UI with 3f907e7, and whisper false, I can repro with my above playerFoo and IsInGroup hacks.

Reloading with latest/HEAD, I get the simplified local print for myself as fake-not-lead.

SabreValkyrn commented 2 years ago

I also did an RFK earlier today and fixed some additional pet handling logic.

Pets and whisper actually being obeyed should fix issues reported in this case. Thanks for the collaboration!