BagSync

BagSync

3M Downloads

Item not found in search, but correctly listed in tooltip count

tflo opened this issue · 64 comments

commented

There is a thing I don't understand:

Today I was searching for a pet and I tried BS's search. It didn't find anything:

bagsync not found


Then I did the same search in Armory. Armory found the pet, and in the pet's tooltip BS is correctly listing the pet locations (2× guild, 1× AH; I verified it):

armory found

I guess that it didn't find anything has to do with the "A total of [n] items were not searched… still waiting…" warning, right?

But obviously BS knows about the location of the item (see tooltip count), so why does it not use that information for the search?

I'm probably failing badly in understanding how BS works, but why does it need to wait for the server to respond at all if the items are cached?

PS:

Clicking the Refresh button several times in intervals of 5 or 10s brings the "not searched" count in the message down, but never completely. When it has reached a certain minimum (e.g. 1576), it goes up again on the next refresh, then down to the minimum again, and up again, etc.

commented

I found the issue, it is related to how the BattlePet names are being treated. I'm putting in checks to ensure the name does get parsed.

commented

BagSync doesn't actually store the full item information (including) the name of items. Instead what is stored is the ItemID. The reason for this is to make sure the information is accurate. Say Blizzard decides to change the name or specs of an Item. If I were to store that information, it would be inaccurate and would have to be updated. That would take extra time to do as I would not only grab the information from the server but also parse the incorrect data.

Instead what BagSync and many other addons do is pull the information from the server using the ItemID. This takes time and the more items there are the longer it takes. The server doesn't always send back every item that is requested, hence the "warning info box" about the server/cache to respond. It's literally waiting for the server to send back the information to BagSync. The number of items should decrease and not increase or reset. That is wrong and I'll need to investigate that.

Let me run a few checks and make sure that the system is working properly. Unless of course Blizzard changed something on their end. The BattlePet should have been listed when you searched for it.

commented

The number of items should decrease and not increase or reset.

Just checked it again on another char: Started with around 4800 "warning" items, after a couple of Refreshs down to 1799, then, with the next Refreshs, 2809, 1802, 2682, 1802, 2675, 1791. Always bouncing between roughly 1800 and 2700.

Here is my database file, in case it helps. It's from several sessions after my post, but the Spinemaw Gormling is still not found:

BagSync.lua.zip

commented

The number of items should decrease and not increase or reset.

Just checked it again on another char: Started with around 4800 "warning" items, after a couple of Refreshs down to 1799, then, with the next Refreshs, 2809, 1802, 2682, 1802, 2675, 1791. Always bouncing between roughly 1800 and 2700.

Here is my database file, in case it helps. It's from several sessions after my post, but the Spinemaw Gormling is still not found:

BagSync.lua.zip

I'll take a look. I have a feeling I know what is going on, but I need to double check.

commented

Damn pets 🫤

commented
commented

My Spinemaw Gormling is happy now. Thanks!

The "not searched" number still doesn't go to zero and bounces (this time between 1220 and 2046). But maybe this is irrelevant, as long as stuff is found.

commented

Go and login to each and every one of your characters on every realm

Will do that over the next few days (~20 chars).

I guess guild bank is enough to check on one toon for each guild, right? Or should I do that too on each?

Void Storage too, I guess? You didn't list it, but there are many pets (in "installer" form) in there.

commented

On a different toon: 6010 --> 1421 --> 0

commented

Back to the first test toon: Same behavior as before.

So, to sum it up, I get 5000+ unsearched items on the first search after login, which can be brought down to zero (aka no warning) with two Refreshes.

And a search without a "not searched" warning is something I never had before! Go figure, I considered it normal, until I noticed that BS does not find things.

commented

You should only need to scan each unique or different Guild Bank once. Meaning a character is in the same guild, then you don't need to scan it. Only each different Guild and Guild Bank.

Void Storage is different for each character so it needs to be scanned yes. >.> I didn't realize you can put Pets into the Void Storage. That is an issue I need to address. I thought only armor and weapons can go in there. Otherwise I'm not sure what you mean by "installer" form, unless you mean Caged?

commented

Also great googly moogly, according to BagSync Debug you have over 8000+ items across all your characters. 😱 😨 That's a lot LOL.....

commented

I didn't realize you can put Pets into the Void Storage

Not pets themselves, but the "installers", if they are 1) soulbound and 2) not unique. Like these, for example:

WoWScrnShot_022423_153744

you have over 8000+ items across all your characters

Yeah, the guys are such hoarders, can't do anything.

commented

Otherwise I'm not sure what you mean by "installer" form, unless you mean Caged?

Oops, I missed that part. But I think the screenshot explains it. The item category is Miscellaneous > Companion Pets, as opposed to Battle Pets (I think), which are the caged ones. You can't put the caged ones in the Void Storage.

commented

I didn't realize you can put Pets into the Void Storage

Not pets themselves, but the "installers", if they are 1) soulbound and 2) not unique. Like these, for example:

Oh those! Yes believe it or not those are actually treated as regular items and not BattlePets. They actually have an ItemID and everything unlike BattlePets. They are not Caged Pets actually, it's an item that just adds to the pet to your Pet Journal. That's it really. Caged Pets are pets that you already have and are transformed to that generic [Pet Cage] itemID. So it would make sense that you can put the ones that are companion pets with an itemid in the Void Storage.

commented

Try this version of BagSync that I just wrote up. I haven't pushed it live yet as I'd like you to test it. It should help with the Server query and responses when having a crazy (ludicrous) amount of items to go through. It may take a few refreshes but eventually should bottom out at zero left and the warning should disappear when doing a search.

BagSync.zip

commented

OK, installed it, thanks.

I will tell my guys that you called them crazy 😝

commented

Did a search for the good ol' Spinemaw Gormling with the test version:

It showed 5000+ "not searched" items. 1st click on Refresh: 1427, 2nd click on Refresh: nothing! (aka zero)

Did a miscellaneous other search: No "not searched" warning at all right from the start!

Looks like you solved the issue 😁

commented

I guess this fix has the potential to also fix the mail issue. BS often was not seeing items in the mail box, where the other addons (Armory, Stash, TSM) had no issues (or rarely issues). I wanted to post that issue next, but I think it is a good idea to verify again with the new version.

commented

Nope, doesn't seem so. Just mailed a pet to an alt and did a BS search immediately after: Mail location is not listed in the BS tooltip (only occurrences in bank, auction, bags, guild bank).

I will open an issue for that later.


PS: In this case, Armory and TSM are failing too. Only Stash sees the pet in the mail location.

commented

Oh I usually write it up and it's not that different from the Mail Scan code that I wrote up. I just didn't have access to grab the SendMail before a success command. The reason the code blew up was because it didn't like the BattlePet I was testing with LOL. Go figure, it's resolved now. So some progress.

commented

the code exploded in my face

Yeah, that's always a good sign 🙃

commented

You could also check how the others are doing it. Here, for example, the mail part from Stash:

Details
-- mail

-- when mail is sent, if any items are involved then save them in pendingSendMail
-- when/if mail is successfully sent, these items will be added to recipient's stash if
-- they have a stash.saved node set up.
-- note the dot notation! this is a hook of a Blizzard API without a self reference
function stash.tracking.SendMailHook(recipient)
    wipe(pendingSendMail)
    -- add any items being sent to pendingSendMail with its count
    for i=1,ATTACHMENTS_MAX_SEND do
        if HasSendMailItem(i) then
            local _,itemID,_,count = GetSendMailItem(i)
            if itemID==C.PET_CAGE_ITEMID then -- item is a caged pet
                local link = GetSendMailItemLink(i)
                itemID = link:match("(battlepet:%d+)")
                if itemID then
                    tinsert(pendingSendMail,itemID)
                end
            elseif count>1 then
                tinsert(pendingSendMail,format("%d:%d",itemID,count))
            elseif itemID  then
                tinsert(pendingSendMail,itemID)
            end
        end
    end
    -- if an item is being sent, insert the realm,player the item(s) are being sent to
    if #pendingSendMail>0 then
        local recipientRealm = GetRealmName()
        if recipient:match("-") then -- send a BoA item to another realm
            recipient,recipientRealm = recipient:match("(.+)-(.+)")
        end
        tinsert(pendingSendMail,1,{recipientRealm,recipient})
    end
end

-- if mail was successfully sent, check if any pending items were being sent
function stash.tracking:MAIL_SEND_SUCCESS()
    if #pendingSendMail>1 then
        local realm,player = pendingSendMail[1][1],pendingSendMail[1][2]
        local otherStash = stash.saved[realm] and stash.saved[realm][player]
        if otherStash then
            for i=2,#pendingSendMail do
                tinsert(otherStash.mail,pendingSendMail[i])
            end
        end
    end
    wipe(pendingSendMail)
end

-- when mail closes, any items in SendMail are released
function stash.tracking:MAIL_CLOSED()
    wipe(pendingSendMail)
end

-- when opening mail, update the current player's mail
function stash.tracking:MAIL_INBOX_UPDATE()
    wipe(stash.current.mail) -- we're checking mail now, can drop stuff that was noted as sent
    for i=1,GetInboxNumItems() do
        if select(8,GetInboxHeaderInfo(i)) then -- if this inbox item has items
            for j=1,ATTACHMENTS_MAX_RECEIVE do
                if HasInboxItem(i,j) then
                    local _,itemID,_,count = GetInboxItem(i,j)
                    if itemID==C.PET_CAGE_ITEMID then -- item is a caged pet
                        -- GetInboxItemLink doesn't use a battlepet link :( so picking up speciesID from tooltip
                        StashGameTooltip:SetOwner(stash.frame,"ANCHOR_NONE")
                        local _,speciesID = StashGameTooltip:SetInboxItem(i,j)
                        if speciesID and speciesID>0 then
                            tinsert(stash.current.mail,format("battlepet:%d",speciesID))
                        end
                        StashGameTooltip:Hide()
                    elseif count>1 then
                        tinsert(stash.current.mail,format("%d:%d",itemID,count))
                    elseif itemID  then
                        tinsert(stash.current.mail,itemID)
                    end
                end
            end
        end
    end
end
commented

Nope, doesn't seem so. Just mailed a pet to an alt and did a BS search immediately after: Mail location is not listed in the BS tooltip (only occurrences in bank, auction, bags, guild bank).

I will open an issue for that later.

PS: In this case, Armory and TSM are failing too. Only Stash sees the pet in the mail location.

You have to physically check the mail with the character receiving it for it to show up in BagSync. Meaning that BagSync doesn't preemptively add the item to outgoing recipient in the Database. The only time the Mailbox ever gets scanned is when you physically check it with a character. If you were to login to the recipients character and check the mailbox it would then show up. Many addon authors including myself don't like doing prediction stuff. For it to work the way you suggested, I'd have to hook into the "MAIL_SENT". Then do loop through ALL the characters on ALL the realms and match the recipient and realm. Then go to their MailBox DB (if they even have one) and add it manually into their DB list.

I'd have to check, but I believe that the MAIL_SENT doesn't send complete information other then a flag that mail was actually sent.

commented

Meaning that BagSync doesn't preemptively add the item to outgoing recipient in the Database.

This is unfortunate, because it is valuable information.

Many addon authors including myself don't like doing prediction stuff.

Technically you are certainly right, though I wouldn't call it 'prediction' in this case, because the probability that the sent item will be in the recipient's mailbox is almost 100%.

Actually this means that BS is treating a mailed item equally to a destroyed/vendored/consumed item (i.e., removed from the DB). From a user's point of view, this is definitely suboptimal, simply because the item still exists (with almost 100% probability).

Just checked it with different non-pet items. Armory, TSM, Stash all show them as in the recipient's mail box, immediately after sending and without switching to the recipient char. So, I guess, the mentioned failure of Armory and TSM in my previous post was probably due to the "irregular" nature of the item (pet cage).

But good to know that this is the intentional behavior of BS, no point in opening an issue then.

After all, there must be a reason why I'm using different inventory addons side by side 😌


Back to the previous issue of this thread:

I guess I can stop my visit-all-storage-locations-on-all-toons action now, right? Seems you fixed the "not searched items" warning with the posted version of BS. (See this post and the following, in case you missed them.)
I tried a couple of more times in the meantime, and the warning reliably goes away after 2 Refreshes, always.

commented

I guess I can stop my visit-all-storage-locations-on-all-toons action now, right? Seems you fixed the "not searched items" warning with the posted version of BS. (See this post and the following, in case you missed them.) I tried a couple of more times in the meantime, and the warning reliably goes away after 2 Refreshes, always.

Not necessarily as I want to ensure that there aren't any issues with the DB. I had made some changes previously to BattlePets and want to make sure it's being treated properly on your end.

Also it's not 100% if there is a chance that a person is sending the item to another user/player unrelated to their characters. To be fair you did say "almost" but 100% implies that it's a definite thing, lol in that scenario it would be like 99%. Therefore you'd have to check to see if the recipient is actually in the DB. In any case I'm reviewing the MAIL_SENT and MAIL_SUCCESS events to make sure that Blizzard didn't change anything that I'm not aware of. If they do send the recipient as part of the event or at least allows a search of send items before transmission, then technically it is possible. It's been a very long time since I review the mail functions and I don't recall them making any significant changes to it, but it's possible.

If there are changes, I don't see an issue with adding the SendMail stuff to BagSync. I'll keep you posted.

commented

Not necessarily as I want to ensure that there aren't any issues with the DB

OK, going on with it then (I'm already done with ~70% of the toons).

Also it's not 100% probability if there is a chance that a person is sending the item to another user/player unrelated to their characters.

True, sorry I was speaking only of mails to alts without saying it. Indeed, mailing an item to a non-account char (other player) actually removes it from the account, so it is correct to remove it also from the DB in this case.

commented

Hmm it appears that you can now GetItemLinks before mail is actually sent and get a success response. They must have changed this as before you weren't able to do this. This means technically that I can actually store the information on the recipients DB entry. I'm going to start working on the code for that.

commented

LOL the code exploded in my face, but I think I'm on the right track. 😆

commented

I sent you the snippet from Stash in particular because the author is good with battle pets 😉 (it's by gello, the author of Rematch).

commented

Try this version of BagSync. It should now properly track the items that you send to a character. Note: Obviously this will only work as long as there is a Character entry in the BagSync database. Meaning you had to at least logged in to that character once EVER so BagSync could have made an entry in the database for that character.

Meaning the following:

  1. On the Character creation screen you create Character B, but never login with Character B.
  2. You login on Character A and send something to Character B.
  3. Obviously since you never logged into Character B, BagSync never made an entry for it. So the mail would not be tracked.

Otherwise if there is an entry in the DB for BagSync then it should work with no problems.
BagSync.zip

commented

Installed…

commented

Seems to work fine, with simple stuff:

WoWScrnShot_022423_232235

…and even with pets:

WoWScrnShot_022423_232400

Damn, was this really necessary? What is now with my "After all, there must be a reason why I'm using different inventory addons side by side"?! 😖

Just joking. Congrats, the addon keeps getting better and better! And of course, thanks for fixing bugs so quickly and for responding to my suggestions!

Still working on visit-all-storage-locations-on-all-toons, should be ready tomorrow or maybe later this evening/night.

commented

Have you noticed the missing stats and the "PetLevel 0" in pet tooltip above?

This seems to happen only with tooltips from the BS search frame. This is the correct tooltip, from the pet cage in the bags:

WoWScrnShot_022423_234123

commented

Or is this normal because the search doesn't differentiate between pet levels and variants/quality?

commented

But honestly I don't really know if it's really worth it. Since you really just want to see who has the BattlePet on what character and the locations it can be found.

This isn't entirely true:

I sell mainly level 25 pets on the AH. When I have sold one, and there isn't another L25 in the AH toon's bank, and no spare L25 in the pet collection, I need to know if and where I have another L25.

If I only have the information that 5 alts have the pet in their bank, without level, then I would have to log in to each of these 5 alts to see if it is a L25 or a L1.

Actually the problem doesn't exist for me, but only because I know that I have most of the L25 on one or two specific toons (besides the AH toon). The other toons have exclusively L1 pets. And in case of doubt, I still can do a search in Armory.

So, just to demonstrate that the level info is in fact a very useful info.

commented

Have you noticed the missing stats and the "PetLevel 0" in pet tooltip above?

This seems to happen only with tooltips from the BS search frame. This is the correct tooltip, from the pet cage in the bags:

WoWScrnShot_022423_234123

Actually that is intended. The reason for this is because BagSync and many other addons only store the SpeciesID. (I checked and Stash also just store the speciesID). The other data is hardcoded in the special BattlePet links that Blizzard generates on a server basis (which btw become invalid once a server reboots). These links contain some of the stats data required to properly display the BattlePet properly. The issue is that on MANY API code functions that Blizzard provide for us, the only option is to pass the SpeciesID or PetID. The PetID is a reference to the index in your Pet Journal where the stats are. That is how Blizzard grabs the stats information to display in the tooltips. The problem is the PetID is not very reliable as those indexes do change. So instead when you pass the SpeciesID it doesn't know which PetID is being referred to and generically just shows everything with 0 stats. This is pretty normal for addon authors. Otherwise we'd have to store every variant and their stats and you can easily have 30 of the same SpeciesID with different levels and stats. It's just too much to have to deal with and at the end of the day using the SpeciesID is just easier. In all honesty working with BattlePets is a pain as Blizzard didn't really think things through or implementing in a way that is easier for addon authors to work with. There is is going to be some limitations.

It may be possible to store some of the stat link only for displaying in BagSync. But honestly I don't really know if it's really worth it. Since you really just want to see who has the BattlePet on what character and the locations it can be found.

Outside of BagSync though in the Blizzard UI the tooltip should work perfectly as it can communicate properly with the Blizzard servers for the information.

commented

Armory actually shows every found instance, which allows to differentiate pet quality and level in the tooltip:

WoWScrnShot_022523_022503


OK, I finished the visit-all-storage-locations-on-all-toons. I didn't visit the Void Bank on a few toons that don't have one yet. One char is fresh and has never visited his bank (nothing in the bank).

Warning behavior is still the same: Number starts high and goes away after two Refreshes.

Here the file after a reload on the last toon:

BagSync.lua.zip

commented

Armory actually shows every found instance, which allows to differentiate pet quality and level in the tooltip:

WoWScrnShot_022523_022503

OK, I finished the visit-all-storage-locations-on-all-toons. I didn't visit the Void Bank on a few toons that don't have one yet. One char is fresh and has never visited his bank (nothing in the bank).

Warning behavior is still the same: Number starts high and goes away after two Refreshes.

Here the file after a reload on the last toon:

BagSync.lua.zip

Thank you, I will take a look at the data and see if I notice any discrepancies. In terms of the refreshes, that will be normal as remember BagSync queries the server for all the item information at least once. Blizzard has a set limit of queries you can perform at a time. Hence why a few refreshes are required. It's only at Login and should persist in the cache for the remainder of the gaming session. Normally folks don't see that warning screen as they don't have 8000+ items. The average I've seen is around 2000 to 3000.

commented

But honestly I don't really know if it's really worth it. Since you really just want to see who has the BattlePet on what character and the locations it can be found.

This isn't entirely true:

I sell mainly level 25 pets on the AH. When I have sold one, and there isn't another L25 in the AH toon's bank, and no spare L25 in the pet collection, I need to know if and where I have another L25.

If I only have the information that 5 alts have the pet in their bank, without level, then I would have to log in to each of these 5 alts to see if it is a L25 or a L1.

Actually the problem doesn't exist for me, but only because I know that I have most of the L25 on one or two specific toons (besides the AH toon). The other toons have exclusively L1 pets. And in case of doubt, I still can do a search in Armory.

So, just to demonstrate that the level info is in fact a very useful info.

This is true, but I only show one result in the Search window per item as BagSync users get the info from the tooltip hover. How would I display 5 of the same pet in various levels when only one item is ever shown? I would have to make significant changes to BagSync to allow for something like this. I don't think I want to invest that much time and effort into making those changes. What I will do however is look into the petData stats, perhaps there is something there I can work with, but considering how some functions only return a SpeciesID it may be difficult. I'm not going to rule anything out and it's worth investigating, but I cannot promise you I'll implement something like this.

commented

How would I display 5 of the same pet in various levels when only one item is ever shown?

Yes, see the screenshot of Armory. This is of course only possible if the search lists every found instance.

I don't think I want to invest that much time and effort into making those changes.

I did not ask that from you because, as said, for me personally this is not a problem because I happen to know which alts are holding the L25s. So, if I find a pet on that alt, it must be a L25. The example was just to show that the level info in search results makes absolutely sense. (And, to a minor degree, also the quality and breed info.)

So please don't bother with it, I imagine it's a lot of work!


Have you noticed the second part of my post with the new DB file after having finished visiting all locations on all toons?

commented

Oh, missed your second post, so forget the last part of my post above.

commented

Blizzard has a set limit of queries you can perform at a time. Hence why a few refreshes are required.

Ah, OK. This would have been my next question 😌

It's only at Login and should persist in the cache for the remainder of the gaming session.

Yep, can confirm this.

commented

But, wouldn't it be possible to do the additional refreshes automatically when needed? Or do you need an hardware event for that?

commented

But, wouldn't it be possible to do the additional refreshes automatically when needed? Or do you need an hardware event for that?

Unfortunately it's a built in restriction on the WOW client. There is no real way to trigger an automatic refresh. Though any new items would fall under the query limit if new ones were added. So technically a refresh from the server wouldn't be necessary after the initial cache is filled on Login. It's a lot of items for WOW server to parse.

commented

No, what I meant is something like this:

Diff
*** /Users/tom/_Tmp ƒ/BagSync/modules/search.lua	2023-02-24 16:54:00.000000000 +0100
--- /Applications/World of Warcraft/_retail_/Interface/AddOns/BagSync/modules/search.lua	2023-02-25 14:52:55.000000000 +0100
***************
*** 677,716 ****
--- 677,722 ----
  					countWarning = checkData(unitObj.data.bag, searchStr, searchTable, tempList, countWarning, viewCustomList, unitObj)
  				end
  			else
  				countWarning = checkData(unitObj.data.bag, searchStr, searchTable, tempList, countWarning, viewCustomList, unitObj)
  			end
  		end
  
  	end
  
  	--show warning window if the server hasn't queried all the items yet
  	if countWarning > 0 then
  		self.warninglabel:SetText(L.WarningItemSearch:format(countWarning))
  
  		if not advUnitList then
  			self.searchbar:SetText(searchStr) --set for the refresh button
  		else
  			self.advancedsearchframe.advsearchbar:SetText(searchStr) --set for the refresh button
  		end
  
  		self.warningframe:Show()
+ 		C_Timer.After(0.5, function()
+ 			self.searchbar:ClearFocus()
+ 			local sbText = self.searchbar:GetText() or ''
+ 			self:DoSearch((string.len(sbText) > 0 and sbText) or Search.searchStr)
+ 		end)
+ 
  	else
  		self.warningframe:Hide()
  	end
  
  	if #searchTable > 0 then
  		table.sort(searchTable, function(a,b) return (a.name < b.name) end)
  		for i=1, #searchTable do
  			self:AddEntry(searchTable[i])
  		end
  		self.scrollframe.frame:Show()
  		self.totalCountLabel:SetText(L.TooltipTotal.." |cFFFFFFFF"..tostring(#searchTable).."|r")
  	else
  		self.totalCountLabel:SetText(L.TooltipTotal.." |cFFFFFFFF0|r")
  		self.scrollframe.frame:Hide()
  	end
  
  end
  
  function Search:DisplayAdvSearchLists()
  

Just a raw hack, but it seems to work fine. For obvious reasons I would throw in a counter to limit the automatic runs to 3 or so, in case something goes wrong.

But, of course, I can as well click the button 2 times myself per session, not a thing.

commented

The good news is I found a bug in regards to the BagSync External Tooltip while looking into the BattlePet data. So that's a nice find!

commented

Ah yes I normally don't do stuff like that because I've had people yell and scream at me about "OMG BAGSYNC CAUSES LAG" or something like "SO MUCH LAG" on this or that... or something to that nature. Or zomg I have like 10,000 items and I have a tiny micro-second frame delay or lag because I'm searching through all my characters across ALL my BattleNet toons because I have the option enabled in BagSync (even though I put a warning about it). Yes this has happened before.

Your hack would technically work, but I would have to literally put an option for it to disable it as folks would complain regardless. I know I sound sarcastic or over the top here, but I've seen it all. 😆

commented

Out of curiosity, I just tried it with the C_Timer at 0 seconds (which means once per frame AFAIK), and it still works. (Without C_Timer, it creates a freeze though.)

commented

people yell and scream at me about "OMG BAGSYNC CAUSES LAG"

Well, those people should consider that the auto-refreshes (even with the C_Timer at 0.5 or 1s) will most certainly be faster then clicking the button twice manually 😉

And if they have only 3000 items, then the auto refresh will not run anyway, as it is tied to the countWarning > 0.

commented

people yell and scream at me about "OMG BAGSYNC CAUSES LAG"

Well, those people should consider that the auto-refreshes (even with the C_Timer at 0.5 or 1s) will most certainly be faster then clicking the button twice manually 😉

And if they have only 3000 items, then the auto refresh will not run anyway, as it is tied to the countWarning > 0.

Technically you are correct and it wouldn't affect some people, but the few that do... just you wait. I see a future ticket.

I also have a dumb or stupid idea. Perhaps I can make some sort of Ctrl_rightclick or shit_rightclick or some stupid button combination so that when you click on an item in the BagSync Search, it pops out a external tooltip with a breakdown of all the items and their locations and character stuff. It wouldn't require me to reprogram an entire search algorithm or window for it. That or some other weirdo way to do it. Eh I'll think about it.

commented

it pops out a external tooltip with a breakdown of all the items and their locations

But this tooltip wouldn't allow to see infos like quality, level, etc., right?

Maybe pop-out another (non-tooltip) frame with the listing of the items, so that each item has its own tooltip and hence would show level, etc. (Similar to Armory's main search result listing).

Again – just to be sure😉 – I do not need really this feature, for the reasons outlined before. (But it would certainly be nice for others.)

commented

it pops out a external tooltip with a breakdown of all the items and their locations

But this tooltip wouldn't allow to see infos like quality, level, etc., right?

Maybe pop-out another (non-tooltip) frame with the listing of the items, so that each item has its own tooltip and hence would show level, etc. (Similar to Armory's main search result listing).

Again – just to be sure😉 – I do not need really this feature, for the reasons outlined before. (But it would certainly be nice for others.)

Possibly, it's something I'll consider throughout the day. Debating on whether it would be worth investing time in doing something like this as I would need to make changes to some item DB stuff.

I added that autoRefresh but limited it to 5 or less refreshes. The counter refreshes when the search window is closed. In case the cache needs to be updated again in the future searches.

commented

Also I didn't notice any discrepancies or issues with the resent data DB dump you gave me. It looks like everything is working as intended. Including the battlePet changes I did. Thank you for taking the time to put that together for me.

commented

I added that autoRefresh but limited it to 5 or less refreshes.

Oh, nice. I just modded my mod so that it runs exactly 2 times (if needed), and only then – if the 2 times weren't enough – it shows the warning text.

Wanted to keep the mod, but now even better if it's "official" 😁

Thank you for taking the time to put that together for me.

Thanks to you for your responsiveness!

commented

I'm rewriting the Guild Bank scanning to be faster and more efficient.

Honestly, for the "faster" part, I never had issues. Usually I need more time to find/put stuff than BS takes for the scan. Very rarely that I have to wait with the close button because BS is still scanning.

commented

It is still much more efficient to scan individual tabs being used then the entire guild bank each time something is changed or opened. It's the difference between 80 slots and 600 slots in scanning. Lessen the time required to parse and ease the work on the server. On top of that it allows to grab the BattlePet data via Tooltip to be quicker. Overall it will be worth it.

commented

I added that autoRefresh but limited it to 5 or less refreshes.

Oh, nice. I just modded my mod so that it runs exactly 2 times (if needed), and only then – if the 2 times weren't enough – it shows the warning text.

Wanted to keep the mod, but now even better if it's "official" 😁

Thank you for taking the time to put that together for me.

Thanks to you for your responsiveness!

Sure thing! I love working with people to sort things out and implement new features.

So two things. One, I'm rewriting the Guild Bank scanning to be faster and more efficient. Right now it scans all the Guild Bank tabs every time it's opened or something is changed. I'm changing this to only store tabs that are actually changed or being viewed. That way it doesn't freaking scan the entire Guild Bank each time. The only downside to this is that I have to change how it's stored in the DB. So you will need to scan all the guild banks individually again by clicking on each tab, since it will only scan when tabs are visited or changed. This will surely increase the speed at which things are done in the bank. In addition it will DEFINITELLY increase the speed at which Battle Pets are handled. Also make things easier for me to track Guild Tabs for display.

Second, I'm still working on the extended feature we talked about. I'm fooling around with different methods.

commented

I have a huge idea for you:

You might have been wondering why I use Stash alongside with other inventory tools (Armory, BS). One of the reasons is its incremental search, aka find-as-you-type. This works blazingly fast, without any noticeable delay, and is a pretty neat QoL thing for the quick lookup. (Try it out!)

Now, I guess Stash can do this only because it stores a bare minimum of item infos in the DB, i.e. mainly just the item ID, not the entire link. The DB looks like this:

Database example from Stash
        [10] = {
          173132, -- [1]
          201954, -- [2]
          199408, -- [3]
          198357, -- [4]
          198131, -- [5]
          194964, -- [6]
          198357, -- [7]
          198357, -- [8]
          194476, -- [9]
          171418, -- [10]
          139812, -- [11]
          199010, -- [12]
          199013, -- [13]
          152096, -- [14]
          139808, -- [15]
          "140749:5", -- [16]
          "140767:20", -- [17]
          199383, -- [18]
          199019, -- [19]
          173242, -- [20]
          "32569:250", -- [21]
          "32569:195", -- [22]
          194503, -- [23]
          198357, -- [24]
          "81055:7", -- [25]
        },

The downside is that also the tooltips on Stash's search results are the bare minimum. This makes Stash unsuitable as the only inventory tool; for a more informative search I still need Armory from time to time (e.g. the darned pet level/quality/breed)1. But these are different use-cases, quick search (Stash), in-depth/detailed search (Armory).

So…, my idea was to combine both search types (quick and detailed) in BS! And, since you are already working on improved search results, I thought that now might be a good the best moment to suggest this 🤓

What I have in mind is roughly this:

When the user types in the search box, BS will initiate an incremental search (find-as-you-type) and list the results in the same frame. If the user now hovers over an entry in the search results list with the mouse, it will do one of two things:

  • In simple cases, it loads the "real" item data (i.e. link and whatnot) and displays the tooltip.
  • If the item has several variants (e.g. pets of the same species with different levels/quality/breeds, or gear with different levels or bonus effects, etc.), then a "details" window will be popped out, which – similar to Armory's default search results – would list all found variants, and therefore allow the user to get the precise tooltip for each found variant.

The second way (pop-out window) could also be triggered by a left click instead of hovering.

For this to work, you very likely would have to implement an additional, light, database (like Stash) that is queried for the quick incremental search. (This would not significantly increase resource usage, my stash file is only 278KB for my crazy 8000+ items.)

Now, feel free to ban me from posting on your Issues page forever… 🙄

Footnotes

  1. It also seems that Stash does not include auctions.

commented

I'm not entirely sure that I can do searches on the fly as you type. The reason for this is because BagSync actually uses an enhanced search that supports commands. These commands allow you to do narrow searches. (yes people use them but they a lot don't know it exists). I'm changing that by adding a help menu that explains the commands. I'd have to see if the search library freaks out with on demand searching as you type. Right now I believe it reads the search line and then interprets the search commands from that. Here are some example search commands.

BagSync Search Commands
	<search> 				:=	<intersect search>
	<intersect search> 		:=	<union search> & <union search> ; <union search>
	<union search>			:=	<negatable search>  | <negatable search> ; <negatable search>
	<negatable search> 		:=	!<primitive search> ; <primitive search>
	<item name search>		:=	n ; name | n:<text> ; name:<text>
	<item bind search>		:=	bind | bind:<type> ; types (boe, bop, bou, boq) i.e boe = bind on equip
	<quality search>		:=	q ; quality | q<op><text> ; q<op><digit> (q:rare ; q:>2 ; q:>=3)
	<ilvl search>			:=	l ; level ; lvl ; ilvl | ilvl<op><number> ; lvl<op><number> (lvl:>5 ; lvl:>=20)
	<required ilvl search>	:=	r ; req ; rl ; reql ; reqlvl | req<op><number> ; req<op><number> (req:>5 ; req:>=20)
	<type / slot search>	:=	t ; type ; slot | t:<text>
	<tooltip search>		:=	tt ; tip; tooltip | tt:<text>
	<text search>			:=	<text>
	<item set search>		:=	s ; set | s:<setname> (setname can be * for all sets)
	<expansion search>		:=	x ; xpac ; expansion | x:<expacID> ; x:<expansion name> ; xpac:<expansion name> ; expansion:<expansion name>
	<keyword search>		:=	k ; key ; keyword | k:<keyword> ; (keywords: soulbound, bound, boe, bop, bou, boa, quest, unique, toy, reagent, crafting, naval, follower, follow, power, apperance)
	<class search>			:=	c ; class | c:<classname> ; class:<classname>
	<op>					:=  : | = | == | != | ~= | < | > | <= | >=

I use a bare minimum database as well. The only thing I really store is the itemid/battlepet fakeid, the amount of items and one or two extra tags for the auctions. That's about it. In fact it's just as simple as Stash DB (I downloaded the addon just to look at it to compare, since you mentioned it.) NOTE: The only time saving an ItemID is a terrible idea is when the item actually changes based on the bonusID in the item links. If I were to just save the itemID that would be incorrect as it would be the base item and not the actual item being used by the character, because it has additional bonusID's. Even Bagnon does it the same way I do. There are many many items, especially legendaries where saving the itemID only is not exactly the correct item. Stash doesn't seem to do this, it always gives you the base item regardless.

Here is an example of my DB
			["reagents"] = {
				[-3] = {
					"124439;11", -- [1]
					"124438;4", -- [2]
					"108996;4", -- [3]
					"3371;58", -- [4]
					"128304;24", -- [5]
					"124104;9", -- [6]
					"124103;21", -- [7]
					"124109;20", -- [8]
					"124121;2", -- [9]
					"124119;16", -- [10]
					"124118;9", -- [11]
					"124117;39", -- [12]
					"124437;65", -- [13]
				},
			},
Here is an example of an item that changes because of the bonusID
			["equip"] = {
				"112666::::::::::::1:6691::::::", -- [1]
				"141647::::::::::::1:768::::::", -- [2]
				"112668::::::::::::1:6691::::::", -- [3]
				"112441::::::::::::1:6691::::::", -- [4]
				"106135::::::::::::1:3631::::::", -- [5]
				"112433::::::::::::1:6691::::::", -- [6]
				"106136::::::::::::1:3631::::::", -- [7]
				"106134::::::::::::1:3631::::::", -- [8]
				"106138::::::::::::1:3631::::::", -- [9]
				"108976::::::::::::1:3631::::::", -- [10]
				"134524::::::::::::1:1795::::::", -- [11]
				"129104", -- [12]
				"128958", -- [13]
				"108955::::::::::::1:3631::::::", -- [14]
				"112388::::::::::::1:6691::::::", -- [15]
				"111535::::::::::::1:3631::::::", -- [16]
			},

112666 is the root itemID but not the actual item being used by that character. Because you need the 1:6691 bonusID's that changes the item to the real one, this affects things like stats and even class sometimes.

here is an example of just regular entries in BagSync.

		["bank"] = {
				[6] = {
					"37101;37", -- [1]
					"37201;11", -- [2]
					"63388;9", -- [3]
					"61399", -- [4]
				},
				[7] = {
					"38633", -- [1]
					"37892", -- [2]
					"45073", -- [3]
					"44731", -- [4]
					"45067", -- [5]
					"48503", -- [6]
					"50741", -- [7]
					"38661", -- [8]
					"21524", -- [9]
					"44803", -- [10]
					"48505", -- [11]
					"38663", -- [12]
					"48501", -- [13]
					"38665", -- [14]
					"44800", -- [15]
					"22279", -- [16]
					"21541", -- [17]
					"19028", -- [18]
					"48978", -- [19]
					"38666", -- [20]
				},
				[8] = {
					"48502", -- [1]
					"38667", -- [2]
					"38668", -- [3]
					"48504", -- [4]
					"38669", -- [5]
					"6835", -- [6]
					"38670", -- [7]
					"39322", -- [8]
					"61448", -- [9]
					"61433", -- [10]
					"59685", -- [11]
					"49118", -- [12]
					"49116", -- [13]
				},
				[10] = {
				},
				[12] = {
				},
				[9] = {
				},
				[-1] = {
					"21100;70", -- [1]
					"21540", -- [2]
					"21213;10", -- [3]
					"64670", -- [4]
					"49693", -- [5]
					"49665", -- [6]
					"41133", -- [7]
					"39286", -- [8]
					"25535", -- [9]
					"17712", -- [10]
					"13582", -- [11]
					"13379", -- [12]
					"49362", -- [13]
				},
				[11] = {
					"46725", -- [1]
					"44792", -- [2]
				},
			},

So as you see it's quite as simple as Stash. What I will investigate is permanently having items Cached for quicker search when a user logins. Something that is already being done when you open the search window. I may enhance that and even store item data for the search library to utilize. It's something that I've been thinking on.

I've even been thinking of extending the search library to add commands for battlepet searches. Something like.
bplvl:12 & bppower:<=200 (battlepet level 12 and power less than or equal to 200) Something like that. You can even negate searches or use 'or' instead of 'and' searches. (union vs intersect) searches basically.

Right now my main focus is to wrap up the Detailed Summary window that I'm doing for a character breakdown of items like in Armory. Secondly, I'm trying to also enhance and quicken the tooltip displays and data processing. The issue I have is that no matter how much I might write the code efficiency, at a certain point large database parses will take a hit. Especially in tooltip displays. Thousands of items get based in a sec when you hover an item to be displayed in tooltip sometimes. It can cause micro lag stutters while processing. I can't really think of a way around this given how much data is read.

I suppose I can use a cache system but good grief would it start taking up more and more memory in WOW client. These are things I have to consider as I chug along.

commented

I have added a cache system to BagSync with the rework. This should work properly now. I'm also wrapping up the Item Summary window. Closing this ticket for the time being.

commented

BagSync actually uses an enhanced search that supports commands […] a lot don't know it exists […] adding a help menu

Good idea, the Help menu. I didn’t know about these commands either. (Though I have to admit that I’m still used to use the searches of Armory/Stash; out of habit, and because BS’s search never did work properly for me. But, since this is fixed now (“items not searched” issue), I’m sure this habit will change :) )

What I will investigate is permanently having items Cached for quicker search when a user logins

Yeah, this is the thing I was wondering in the OP of this thread when I asked “but why does it need to wait for the server to respond at all if the items are cached?”

I have added a cache system to BagSync

Great!

I suppose I can use a cache system but good grief would it start taking up more and more memory in WOW client.

I think memory usage is rarely an issue nowadays, no? Probably it will add 100ms to the load time, but well ;)
In my setup ATT and TSM are so far above any other addon in terms of memory, that it really shouldn't matter at all.

Memory usage WoWScrnShot_031123_141606

commands for battlepet searches. Something like.
bplvl:12 & bppower:<=200

Nice idea. From my (pet trader and collector's) point of view, level and breed would be the most important things. (IMO, things like power or similar pet stats are mostly a thing that is interesting inside Rematch (or Blizz Pet Journal), and Rematch comes with it's own tooltips.)

But I guess breed would introduce further complications because of the need of a library? But well, I guess most pet people have installed BattlePetBreedID, and also jaliborc's widely used PetTracker comes with a public lib for that, IIRC.

BTW:

BS's tooltip counts, with the recently added mail count, are pretty much perfect now. Mail count seems reliable, and I have also the impression that the AH counts are more reliable now. (But the latter could also be a coincidence, i.e., maybe they always have been reliable and I just stumbled upon some edge cases in the past.)

commented

Nice idea. From my (pet trader and collector's) point of view, level and breed would be the most important things. (IMO, things like power or similar pet stats are mostly a thing that is interesting inside Rematch (or Blizz Pet Journal), and Rematch comes with it's own tooltips.)

But I guess breed would introduce further complications because of the need of a library? But well, I guess most pet people have installed BattlePetBreedID, and also jaliborc's widely used PetTracker comes with a public lib for that, IIRC.

breed? Not sure what you mean there. I'll have to look at the PetJournal API to see.

Please create a new ticket so we can continue from there. This one is growing too big already and I've closed it. 😄

commented

Please create a new ticket so we can continue from there. This one is growing too big already and I've closed it.

Oh, no worries, I don't have issues with closed threads; you have first closed this one already 2 weeks ago 😉

But here you go: #271