0xbs / premade-groups-filter

A World of Warcraft addon for powerful filtering of premade group listings.
GNU General Public License v2.0
76 stars 40 forks source link

[Bug] AddOn 'PremadeGroupsFilter' tried to call the protected function 'GetPlaystyleString()'. #89

Closed tryallthethings closed 2 years ago

tryallthethings commented 2 years ago

Receiving a lot of errors from the addon in Bugsack:

93x [ADDON_ACTION_BLOCKED] AddOn 'PremadeGroupsFilter' tried to call the protected function 'GetPlaystyleString()'.
[string "@!BugGrabber\BugGrabber.lua"]:519: in function <!BugGrabber\BugGrabber.lua:519>
[string "=[C]"]: in function `GetPlaystyleString'
[string "@FrameXML\LFGList.lua"]:3508: in function <FrameXML\LFGList.lua:3499>
[string "=[C]"]: ?
[string "=[C]"]: in function `LFGListUtil_SetSearchEntryTooltip'
[string "@FrameXML\LFGList.lua"]:2576: in function <FrameXML\LFGList.lua:2573>
[string "=[C]"]: ?

Potential duplicate of #88, although my account is fully secured:

image

Running latest version of Premade Groups Filter (2.8.2).

0xbs commented 2 years ago

Very interesting. Are you able to create premade mythic plus groups with custom arbitrary titles and comments, especially a Mists of Tirna Scithe group? I am testing against the mists dungeon, maybe you are not authenticated for that dungeon for another reason like not being character level 60 or something else.

tryallthethings commented 2 years ago

image

No issues there. Also no LUA errors in Bugsack.

tryallthethings commented 2 years ago

One thing I forgot to mention: I'm not having any issues with Premade Groups Filter, I just noticed the LUA errors in Bugsack. So I can't really tell you when the issues occurred or know how to reproduce them.

0xbs commented 2 years ago

Thank you. The error/BugSack should be reproducible by hovering over an entry in group list filtered by PGF. The tooltip triggers it, because it tries to show the play style in the second line of the tooltip which fails if PGF removes groups from the list and hence taints the code because GetPlaystyleString is protected.

So this BugSack simply means that you cannot see the play style in the tooltip and should not have any other consequences. Still, I would like to analyze the issue as it should not have occurred in the first place.

Could you please type /dump C_LFGList.IsPlayerAuthenticatedForLFG(703) into your chat window and see if it returns true or false? This checks if you are allowed to create groups with arbitrary titles for mists on mythic plus.

Also do you have a keystone for mists in your bags? This could change some behavior on Blizzards side.

If the above function returns true, my code should apply a fix for the BugSack. So maybe another addon is doing something strange. In this case please do another test with all addons disabled except PGF. Simply apply a PGF filter and hover over a group.

If it returns false, I do not apply a fix because I assume that you cannot use custom titles. At least that's what I understand from reading Blizzard's interface code. This would explain the BugSacks, but not why you are allowed to create groups with custom titles.

tryallthethings commented 2 years ago

Thank you. The error/BugSack should be reproducible by hovering over an entry in group list filtered by PGF. The tooltip triggers it, because it tries to show the play style in the second line of the tooltip which fails if PGF removes groups from the list and hence taints the code because GetPlaystyleString is protected.

Yes, that works. But only once after starting the game and logging into the character.

Could you please type /dump C_LFGList.IsPlayerAuthenticatedForLFG(703) into your chat window and see if it returns true or false? This checks if you are allowed to create groups with arbitrary titles for mists on mythic plus.

Returns true for me.

Also do you have a keystone for mists in your bags? This could change some behavior on Blizzards side.

No, I currently have Tazavesh Streets and Court of Stars in my inventory.

If the above function returns true, my code should apply a fix for the BugSack. So maybe another addon is doing something strange. In this case please do another test with all addons disabled except PGF. Simply apply a PGF filter and hover over a group.

The error also appears with only Buggrabber, Bugsack and PGF active. I tried this on another char with no keystone in the inventory.

cremor commented 2 years ago

I can confirm this problem. My account is also fully secured and I can create custom groups. But that error is thrown and I can't see the play style in tooltips. The dump command posted above also returns true for me.

I've noticed that the error is not thrown again after an UI reload. Play style is also shown fine after a UI reload. Only a full relog causes the error again.

0xbs commented 2 years ago

This is very helpful. I assume that when the addon is initalized after a relog, the information if an account is fully secured is not yet fully available and the function briefly returns false.

On a later reload (not relog) the data is already in the cache and hence everything works as expected.

To fix the issue, I have to somehow postpone the call to IsPlayerAuthenticatedForLFG().

rodneycheung commented 2 years ago

This is very helpful. I assume that when the addon is initalized after a relog, the information if an account is fully secured is not yet fully available and the function briefly returns false.

On a later reload (not relog) the data is already in the cache and hence everything works as expected.

To fix the issue, I have to somehow postpone the call to IsPlayerAuthenticatedForLFG().

Yes you are right. I called the function with the event "ADDON_LOADED" and it works. My key is not mists, so i changed the id. Upon logging in I directly opened PGF finder and no error.

I'm just a copy-paster, so there might be a better solution 😄

tryallthethings commented 2 years ago

On a later reload (not relog) the data is already in the cache and hence everything works as expected.

To fix the issue, I have to somehow postpone the call to IsPlayerAuthenticatedForLFG().

I doubt that this will fix the issue. Even after being logged in for a while (> 10 minutes) the error still appears. What I (and probably @cremor too) meant, was that the error only appears once after logging into a character, opening the group finder with a PGF filter active (partyfit in my case, but even without any filters active it happens) and hovering over any listed key.

It doesn't appear each time you open the group finder. Only after you switch to a different character or return to the character selection screen + log into the same character again, the issue will appear again once.

Edit: If it makes any difference: The error seems only to appear for Dungeons, Raids - Shadowlands and Custom groups, but not for Questing, Raids - Legacy, Torghast or PVP groups.

rodneycheung commented 2 years ago

On a later reload (not relog) the data is already in the cache and hence everything works as expected. To fix the issue, I have to somehow postpone the call to IsPlayerAuthenticatedForLFG().

I doubt that this will fix the issue. Even after being logged in for a while (> 10 minutes) the error still appears. What I (and probably @cremor too) meant, was that the error only appears once after logging into a character, opening the group finder with a PGF filter active (partyfit in my case, but even without any filters active it happens) and hovering over any listed key.

It doesn't appear each time you open the group finder. Only after you switch to a different character or return to the character selection screen + log into the same character again, the issue will appear again once.

Edit: If it makes any difference: The error seems only to appear for Dungeons, Raids - Shadowlands and Custom groups, but not for Questing, Raids - Legacy, Torghast or PVP groups.

But postponing the call to that function indeed does the trick. no error any more on my side 😄 The thing now is someone without authenticator shall test whether the postpone thing works

tryallthethings commented 2 years ago

But postponing the call to that function indeed does the trick. no error any more on my side 😄 The thing now is someone without authenticator shall test whether the postpone thing works

Could you please share your copy-pasta for me to try?

cremor commented 2 years ago

@tryallthethings No, @0xbs understood me correctly. It doesn't matter how long you wait to open the LFG list. The addon checks the value of that function immediately on login.

rodneycheung commented 2 years ago

But postponing the call to that function indeed does the trick. no error any more on my side 😄 The thing now is someone without authenticator shall test whether the postpone thing works

Could you please share your copy-pasta for me to try?

Here we go

local myFrame = CreateFrame("Frame")
myFrame:RegisterEvent("ADDON_LOADED")
myFrame:SetScript("OnEvent",
  function()
    local activityIdOfArbitraryMythicPlusDungeon = 2286 -- Mists of Tirna Scithe
    if C_LFGList.IsPlayerAuthenticatedForLFG(activityIdOfArbitraryMythicPlusDungeon) then
        C_LFGList.GetPlaystyleString = getPlaystyleStringFixed
        LFGListEntryCreation_SetTitleFromActivityInfo = function(_) end
    end
  end
);
0xbs commented 2 years ago

If ADDON_LOADED is a sufficient delay for you guys, I will implemented the fix as suggested and release a new version tomorrow if my time schedule works out. Still strange that I never encountered the issue myself, but could be different on other regions or realms.

cremor commented 2 years ago

I havent tested it myself yet. But isn't ADDON_LOADED still very early in the login process? Maybe PLAYER_LOGIN would be a better event?

Also, isn't ADDON_LOADED fired for each addon that is loaded? So the code posted by @rodneycheung would be executed multiple times.

0xbs commented 2 years ago

Yes, PLAYER_LOGIN is better and the code above is executed for every addon. I already considered that. Just give me some time until my actual work finishes and I will do the changes.

Might also only apply the patch if the dungeon finder window is opened.

0xbs commented 2 years ago

Resolved in version 2.8.3

tryallthethings commented 2 years ago

Looks good. Can't reproduce the error anymore. 😄 Thank you!

Iowerth commented 8 months ago

Hi. I read FAQ, but - what if I have no possibility to secure my account because of Blizzard's restrictions to my country? I don't need automatic group titles, I just need absence of this error.

0xbs commented 8 months ago

Please open a new issue instead of commenting on very old ones.

You could remove or comment out line 35 in FixGetPlaystyleString.lua: https://github.com/0xbs/premade-groups-filter/blob/0309e8475d586d39d384b8920d251fecfa4d7312/Fixes/FixGetPlaystyleString.lua#L35