Thread Tools Display Modes
06/15/24, 11:36 PM   #1
cyxui
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 69
GetCurrentTradingHouseGuildDetails might return wrong info sometimes

I am trying to debug a very strange behavior where a small percentage of users will have listings with the wrong guild name posted on TTC.

All data beside the guild name are correct. The wrong guild names in question are always a guild right besides the correct guild in the same area.

I have triple checked the code and made sure that theres no race condition. I always call GetCurrentTradingHouseGuildDetails each time before i store the data. No cache involved. The fact that the wrong guild name is always in the same area made me believe that the GetCurrentTradingHouseGuildDetails will sometimes return the wrong guild name under certain circumstances.

Haven't found a way to reproduce it yet. Any idea is welcomed.
  Reply With Quote
06/16/24, 06:28 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,068
I'd first ask the users to search their live/AddOns folder for that string GetCurrentTradingHouseGuildDetails (using Notepad++ portable -> search in files *.lua e.g., or windows search -> search with enabled setting to search within files *.lua) to see if any other addon uses or even changes/overwrites it.
Maybe, if 2+ users answer with the same addon names you got soemthing to check in advance.

If not, it might be an API bug. Always hard to track such if you got no reliable way to reproduce...
  Reply With Quote
06/16/24, 08:41 AM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,589
AwesomeGuildStore replaces both GetSelectedTradingHouseGuildId and GetCurrentTradingHouseGuildDetails in order to be able to show data independently from the actually selected guild without rewriting half the UI code. However that should only affect the returned values when the player is at a guild they are a member of.

Maybe some other addon they have also replaces GetCurrentTradingHouseDetails with its own code and the affected guild is one they have joined? I could imagine that causing a mismatch between the id and name.

You could try adding some code to keep track of guild names they have seen and their respective guild id and if there is a mismatch when you fetch the name throw an error? Maybe that way you can get some additional information on those cases.
  Reply With Quote
06/16/24, 10:02 AM   #4
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 680
cyxui, something I do differently when recording a listing and AGS is detected. I look at the listing data from AGS. I do use GetCurrentTradingHouseGuildDetails() when AGS is not detected and in a few other places, but not when recording a listing while AGS is detected. In fact I avoid using most of the vanilla functions when AGS is detected. I have separate routines for AGS and Vanilla for posted items, canceled items, purchased items, and listings once the kiosk is open.
  Reply With Quote
06/16/24, 12:08 PM   #5
cyxui
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 69
Originally Posted by Baertram View Post
I'd first ask the users to search their live/AddOns folder for that string GetCurrentTradingHouseGuildDetails (using Notepad++ portable -> search in files *.lua e.g., or windows search -> search with enabled setting to search within files *.lua) to see if any other addon uses or even changes/overwrites it.
Maybe, if 2+ users answer with the same addon names you got soemthing to check in advance.

If not, it might be an API bug. Always hard to track such if you got no reliable way to reproduce...
Problem is that i have no way to tell which user is having this issue... it is hard indeed.
  Reply With Quote
06/16/24, 12:09 PM   #6
cyxui
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 69
Originally Posted by sirinsidiator View Post
AwesomeGuildStore replaces both GetSelectedTradingHouseGuildId and GetCurrentTradingHouseGuildDetails in order to be able to show data independently from the actually selected guild without rewriting half the UI code. However that should only affect the returned values when the player is at a guild they are a member of.

Maybe some other addon they have also replaces GetCurrentTradingHouseDetails with its own code and the affected guild is one they have joined? I could imagine that causing a mismatch between the id and name.

You could try adding some code to keep track of guild names they have seen and their respective guild id and if there is a mismatch when you fetch the name throw an error? Maybe that way you can get some additional information on those cases.
Does that mean the overwritten GetSelectedTradingHouseGuildId by AGS might return guildName = A when the guild name is actually B?
  Reply With Quote
06/16/24, 12:10 PM   #7
cyxui
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 69
Originally Posted by Sharlikran View Post
cyxui, something I do differently when recording a listing and AGS is detected. I look at the listing data from AGS. I do use GetCurrentTradingHouseGuildDetails() when AGS is not detected and in a few other places, but not when recording a listing while AGS is detected. In fact I avoid using most of the vanilla functions when AGS is detected. I have separate routines for AGS and Vanilla for posted items, canceled items, purchased items, and listings once the kiosk is open.
Any examples? Specifically the guild name part
  Reply With Quote
06/16/24, 01:31 PM   #8
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,589
Originally Posted by cyxui View Post
Does that mean the overwritten GetSelectedTradingHouseGuildId by AGS might return guildName = A when the guild name is actually B?
No. AGS on it's own will always return the correct set of guildName and id.

What I mean is that if some other addon replaces only one of these functions and does not properly call the replacement from AGS, but instead the original ingame function (e.g. because it stored a reference before AGS was initialized), there may be a mismatch, since the id returned by GetSelectedTradingHouseGuildId could be for a different guild than what GetCurrentTradingHouseGuildDetails returns in that situation.

But that's just a theory. I haven't heard of any such issues and the code has been in the addon for more than 5 years.

EDIT: on second thought, even if only one function were replaced, it shouldn't matter for kiosks, since they only have one guild, so AGS would always return the value from the original api anyway. So this probably has nothing to do with the issue you see.

Last edited by sirinsidiator : 06/16/24 at 01:39 PM.
  Reply With Quote
06/17/24, 10:45 AM   #9
cyxui
AddOn Author - Click to view addons
Join Date: Nov 2015
Posts: 69
Originally Posted by sirinsidiator View Post
No. AGS on it's own will always return the correct set of guildName and id.

What I mean is that if some other addon replaces only one of these functions and does not properly call the replacement from AGS, but instead the original ingame function (e.g. because it stored a reference before AGS was initialized), there may be a mismatch, since the id returned by GetSelectedTradingHouseGuildId could be for a different guild than what GetCurrentTradingHouseGuildDetails returns in that situation.

But that's just a theory. I haven't heard of any such issues and the code has been in the addon for more than 5 years.

EDIT: on second thought, even if only one function were replaced, it shouldn't matter for kiosks, since they only have one guild, so AGS would always return the value from the original api anyway. So this probably has nothing to do with the issue you see.
What if user is accessing the store thru the banker NPC? What would the behavior be
  Reply With Quote
06/17/24, 02:39 PM   #10
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,589
Originally Posted by cyxui View Post
What if user is accessing the store thru the banker NPC? What would the behavior be
In that case it could suffer from the issue as described, since AGS may have virtually selected a different guild than the game api.
But as I said. That's only the case IF there is some other addon doing something wrong and I haven't heard about anything like that in the past 5 years.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » GetCurrentTradingHouseGuildDetails might return wrong info sometimes


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off