BagSync

BagSync

3M Downloads

Bagsync freezes the complete game

Lirieth opened this issue ยท 23 comments

commented

Found out that the combination with the LJDProfession-Addon is deadly. Dunno why. Both work fine as long as the other addon is deactivated. Both worked fine together before 10.x...

Nevertheless: even with LJDProfession deactivated Bagsync slows down the game to an almost freeze while loading the character. Takes between 5 to 10 seconds until the game unfreezes. Does it sync server data during that time?


Latest client of WOW. German. Latest version of BagSync. Variables have been deleted and BagSync has been newly installed.
Launching the game with BagSync enabled causes the game to freeze directly after the character appears and the environment is rendered. WOW has to be finished using the task manager.
Because of that I'm not able to post an error log, sorry :-o

commented

Tried activating one addon after another on my DH and everything worked. Copied the WTF-Folder of my DH into my DK's WTF-Folder and the game froze after loading. I'm aghast. Was suspicous towards "Already Known" but on other chars it worked well together with BagSync. At the morning (12 hrs ago) and after updating other addons everything did function. Also the lag was severly reduced because of...reasons, I guess. I'll be testing some other combinations tomorrow.

commented

Hello,

I have the same situation on most characterss, so here is some more anecdotal evidence. So far it seems to be caused by AllTheThings and BagSync running at the same time. I suppose that could make sense, as I imagine both addons are of the "scan all your stuff" variety.

But on another character disabling AllTheThings only helped a little bit. Maybe it's not just a particular addon, but at a certain point too many addons are doing something "on load". Stuff like Details, Auctionator, BetterWardrobe, perhaps.

There are no LUA errors, it just seems to freeze because of high load.

commented

Hello,

I have the same situation on most characterss, so here is some more anecdotal evidence. So far it seems to be caused by AllTheThings and BagSync running at the same time. I suppose that could make sense, as I imagine both addons are of the "scan all your stuff" variety.

But on another character disabling AllTheThings only helped a little bit. Maybe it's not just a particular addon, but at a certain point too many addons are doing something "on load". Stuff like Details, Auctionator, BetterWardrobe, perhaps.

There are no LUA errors, it just seems to freeze because of high load.

That is what I'm suspecting is going on. There is a lot of addons that do heavy loading of data when they initialize during login. The more of these installed, the more of a delay you will get as data is being processed. After everything is loaded though within a few seconds or so, the game should function just fine for the remainder of the play session.

Yes you are right, multiple addons that do the same thing will be utilizing the same scanning procedures, so you are bound to have a slowdown. AllTheThings does QUITE a lot of stuff in the background and has an extensive database. So it will definitely slowdown your system during the login process. The same thing with BagSync, if you have a crazy or ludicrous amount of characters across multiple servers, it's going to eventually take it's toll and slow down the login process slightly as it loads all the data.

There really isn't much a developer can do to get by this situation. The more addons that are being loaded the more memory that is required and more data that needs to be processed.

Still it would be interesting to see what @Lirieth finds in their experiments. Thanks for providing your insight @hdoddema ! It's extremely welcomed and helps sheds some light into the issue.

commented

Activating all addons I suspect of having a heavy start-up workload, namely:

Already Known?
Altoholic / DataStore
Autionator
Bagsync
Better Wardrobe
Caedron Wardrobe
Can I Mog It
Collectinator
Dugi Questing Essential
GatherMate 2 / GatherMate 2 Data / Gathermate_Sharing
Have I Done That
Hekili
Inspect Equip
Inventorian
LootFinder
MobInfo2 Retail
MogIt
mOnAr's WardrobeHelper
Simple Item Level
Titan Panel Core + Mythic Dungeons + Currencies + Gold + Performance + Repair + Treasury
What's On The Map
Where To Gather

on my lvl10 druid, him without being in a guild, having almost no stuff in his bags and no crafting abilities causes no slowing down at all.

Activating all those addons on my lvl50 DH (being in a guild) causes a slowing down to 12 - 15 seconds (after the loading bar finished).

Activating all addons I use on my fully fledged lvl60 DK causes an ridiculous slow down during initial rendering but deactivating BagSync significantly speeds up the rendering from 53 - 92 seconds to 10 seconds (after finishing the loading bar) on a AMD Ryzen 3700X with 64GB RAM.

commented

You are fantastic! Thank you for taking so much of your time to look and debug the situation on your end. I really do appreciate it and it allows me to get a better insight of what is going on your end. ๐Ÿ˜„ It really does help me and I do enjoy when others try to debug things with me.

So after looking at your list:
๐Ÿ˜ฎ You have A LOT of data addons being loaded during startup. A few of them actually do very similar scans and perform the same DB storage that BagSync does.

For example: Altoholic / DataStore are enormous in terms of data they store and process. You are basically storing a ton of information on ALL your characters through all the realms. Which is exactly what BagSync is doing. Not sure why you are using both? I suppose you like the UI interface of Altoholic :smile

Collectinator, MogIt, Autionator, Where To Gather, etc.. etc.. You have quite a bit of data storing, processing and displaying with these addons. In addition don't forget that BagSync stores a lot of information about your characters as well. This includes all your bags, bank, guildbank, auction, professions, currency, etc... Now duplicate that with how many characters you have spanning multiple realms? That's quite a bit of data! ๐Ÿคฃ It's only natural that you will have a slight pause when loading all these addons during your login process. There is a lot going on in the memory when you login.

If you would like to see how much memory addons are taking, you can hover over your Game Menu button. It should tell you how much memory each addon is taking up. In this day in age where people have GIGS of memory. It shouldn't be an issue at all. Don't get so worried about Megabytes. When you should worry if is an addon is taking up Gigabytes.

image

I recently did a debugging check of all the loading processes that BagSync does. It's very basic with the modules being loaded and then the initial bag and equipment scan is done when you login. That's pretty much it. Nothing else gets processed outside of checking for expired Auction House items. So I cannot fathom how you are having it take more than a minute to load. I'm a bit baffled honestly as my game loads in literally 5 or 10 seconds with a ton of addons installed myself and BagSync. Granted I don't have as many data storing ones as you, but no where near taking 1 minute.

That only thing I can think of is that you have a ludicrous amount of characters on multiple servers. I suggest enabling BagSync first and then activating other addons one at a time. Check to see if you still take 1 minute or more to load. Perhaps it's a combination with another addon that is causing BagSync to take so long to load. Otherwise if JUST (and only have BagSync) loaded and it's taking 1 minute, then something is wrong.

Please let me know with your tests ๐Ÿ˜„ . What I can do is add a startup delay to the initial scanning process for BagSync. That may help but I highly doubt it.

commented

Oh I forgot to mention that with Addon memory. Once Garbage Collection kicks in memory usage usually drops a lot for each addon. Usually takes about a minute or so after logging in. Example initial BagSync takes up 15MB in memory. When I'm fully logged in and after awhile it drops to 1.5MB instead.

commented

It's really kinda unpredicatble beyond "LJDProfession" :-(

On my lvl10 druid (not in a guild) it lagged like mad. Yesterday. Today everything's fine.
On my DK it nukes the game with all the addons (far too much) activated.
I started deactivating addons on my DH beginning with everything handling alts and professions but have not found the culprit.
Tomorrow (6pm here in Germany) I'll be starting (on DH) with only BagSync and gradually activating addons. I did on my guildless druid but everything worked out well...

commented

Thanks for doing these tests to help pinpoint if it's another addon or conflict of addons. If you still get the lag and it's only BagSync installed then we can work from there. Otherwise if it's only every once in awhile and with other addons, it could be something else happening.

Just let me know what you come across with your tests.

commented

These kind of bugs are extremely difficult for me to fix without some sort of error. Especially if I can't reproduce the issue on my end. So tackling it requires back and forth assistance with someone to figure out what's going on. I'm not getting these 5 to 10 seconds pauses/freeze on my WOW client. There is an initial bag scan when you login to your character and some minor cleanup to the professions DB that is very tiny but that's about it.

What I can do is disable that and see if that is causing the issue for you on start up and we can work from there.

commented

Thanks for your support :-D

The intial lagging after the character appears on screen reminds me of the lag during "cleaning up" Gathermate's database. So I've got the feeling some heavy DB-scrubbing is going on. Perhaps there could be an option to cleanup database manually or automatically. But if you could do a test build without database cleanup I'd gladly install it :-)

commented

Hmm is it EVERY single time you login on every character? Or is it just once in awhile? If it's every single time then we can start removing stuff from the code to see what line is triggering it.

Also with BagSync the only addon loaded and everything else disabled. Does this issue still happen?

commented

After updating some of those addons I found out that the data collecting addons no longer or to a lesser degree slow down the start-up of WOW. So I have tested out some of those addons that really stress the CPU and after testing the likes of ConvertRating, Hekili, TipTac, Dugi, HaveIDoneThat or CaerdonWardrobe I have found that Hekili really slows down the start of WOW - in combination with BagSync. Kinda amazing because Hekili is a combat addon...What also amazes me is that ConvertRating, an addon that does only convert absolute stats on item tooltips into percentage ratings is really taking up quite a lot CPU time,...

commented

Whoops LOL pressed the wrong button.

I think honestly at this point it's just a combination of things going on with the types of addons you have installed. I'm sure after your initial login you don't have anymore issues during your play session. So since it's only during your initial login sequence, it may be best just to endure the small inconvenience during the first login sequence. That way you can enjoy the rest of your play session since it shouldn't affecting it during loading screens.

I will put a small startup delay on BagSync for the next release. Allowing other addons to process before BagSync kicks in a bit for ONLY the bag scanning. The rest of BagSync will still load normally. This should at least help alleviate some of the initial loading you may be having. Granted it's not going to do a HUGE difference, but it would at least allow the other addons to breath a little bit.

commented

Commenting out LibSearchItem's odd "every event" item lookup seems to have helped for me. Changed to:

--	Lib.Scanner:SetScript('OnEvent', function()
--		Lib.Filters.tipPhrases.keywords[FOLLOWERLIST_LABEL_CHAMPIONS:lower()] = Lib:TooltipLine('item:147556', 2)
--		Lib.Filters.tipPhrases.keywords[GARRISON_FOLLOWERS:lower()] = Lib:TooltipLine('item:147556', 2)
--	end)
commented

Commenting out LibSearchItem's odd "every event" item lookup seems to have helped for me. Changed to:

--	Lib.Scanner:SetScript('OnEvent', function()
--		Lib.Filters.tipPhrases.keywords[FOLLOWERLIST_LABEL_CHAMPIONS:lower()] = Lib:TooltipLine('item:147556', 2)
--		Lib.Filters.tipPhrases.keywords[GARRISON_FOLLOWERS:lower()] = Lib:TooltipLine('item:147556', 2)
--	end)

Did it significantly cause a difference? Oddly enough that Library is from Bagnon actually. LibSearchItems is used by Bagnon and was created by it's author. So many people use Bagnon that I'm a bit surprised you are having an issue with it.

Please let me know how much of an impact it has done and I'll do some testing on my end too ๐Ÿ˜„

commented

I'll reopen the ticket. Thank you so much for your contribution @greerga . I look forward to hearing back from you.

commented

I have a ton of add-ons and those lines are the difference between the game freezing for 1+ minutes on login (when present) or the game being immediately responsive when I login (when commented out). It's easy to swap the code in or out and login characters and immediately see the impact.

Addons are: !!NoTaint2, !Swatter, ACU, Accountant, Ace3, AckisRecipeList, AckisRecipeList_Alchemy, AckisRecipeList_Blacksmithing, AckisRecipeList_Cooking, AckisRecipeList_Enchanting, AckisRecipeList_Engineering, AckisRecipeList_FirstAid, AckisRecipeList_Inscription, AckisRecipeList_Jewelcrafting, AckisRecipeList_Leatherworking, AckisRecipeList_Mining, AckisRecipeList_Tailoring, AddonFactory, AddonUsage, AdvancedInterfaceOptions, AllTheThings, Altoholic, Altoholic_Achievements, Altoholic_Agenda, Altoholic_Characters, Altoholic_Grids, Altoholic_Guild, Altoholic_Options, Altoholic_Search, Altoholic_Shadowlands, Altoholic_Summary, ArtifactTab, AskMrRobot, BFAInvasionTimer, BFAInvasionTimer_Options, BadPet, BagSync, BagSync.patch, BankStack, BankStack.patch, BattlePetBreedID, BetterIconSelector-KeywordData, BtWQuests, BtWQuestsBattleForAzeroth, BtWQuestsDragonflightPrologue, BtWQuestsLegion, BtWQuestsShadowlands, BtWQuestsShadowlandsPrologue, CQuestCounter, CanIMogIt, Configator, DBM-AQ20, DBM-AQ40, DBM-Affixes, DBM-AntorusBurningThrone, DBM-BWL, DBM-BaradinHold, DBM-BastionTwilight, DBM-BfA, DBM-BlackTemple, DBM-BlackrockFoundry, DBM-BlackwingDescent, DBM-Brawlers, DBM-BrokenIsles, DBM-CastleNathria, DBM-Challenges, DBM-ChamberOfAspects, DBM-Coliseum, DBM-Core, DBM-CountPack-HotS, DBM-CountPack-Overwatch, DBM-CrucibleofStorms, DBM-DMF, DBM-Draenor, DBM-DragonIsles, DBM-DragonSoul, DBM-EmeraldNightmare, DBM-EternalPalace, DBM-EyeOfEternity, DBM-Firelands, DBM-GUI, DBM-HeartofFear, DBM-HellfireCitadel, DBM-Highmaul, DBM-Hyjal, DBM-Icecrown, DBM-Karazhan, DBM-MC, DBM-MogushanVaults, DBM-Naxx, DBM-Nighthold, DBM-Nyalotha, DBM-Onyxia, DBM-Outlands, DBM-Pandaria, DBM-Party-BC, DBM-Party-BfA, DBM-Party-Cataclysm, DBM-Party-Classic, DBM-Party-Dragonflight, DBM-Party-Legion, DBM-Party-MoP, DBM-Party-Shadowlands, DBM-Party-Vanilla, DBM-Party-WoD, DBM-Party-WotLK, DBM-PvP, DBM-SanctumOfDomination, DBM-Scenario-MoP, DBM-Sepulcher, DBM-Serpentshrine, DBM-Shadowlands, DBM-SiegeOfOrgrimmarV2, DBM-StatusBarTimers, DBM-Sunwell, DBM-TerraceofEndlessSpring, DBM-TheEye, DBM-ThroneFourWinds, DBM-ThroneofThunder, DBM-TimelessIsle, DBM-TombofSargeras, DBM-TrialofValor, DBM-Uldir, DBM-Ulduar, DBM-VPVEM, DBM-VaultoftheIncarnates, DBM-VoA, DBM-WorldEvents, DBM-ZuldazarRaid, DataStore, DataStore_Achievements, DataStore_Agenda, DataStore_Auctions, DataStore_Characters, DataStore_Containers, DataStore_Crafts, DataStore_Currencies, DataStore_Garrisons, DataStore_Inventory, DataStore_Mails, DataStore_Pets, DataStore_Quests, DataStore_Reputations, DataStore_Spells, DataStore_Stats, DataStore_Talents, DeathNote, DejaCharacterStats, DontBuyIt, GarrisonMissionManager, GatherMate2, GatherMate2_Data, GatherMate_Sharing, Grail, Grail-Achievements, Grail-NPCs, Grail-NPCs-retail, Grail-NPCs-retail-enUS, Grail-NPCs-enUS, Grail-Quests, Grail-Quests-retail, Grail-Quests-retail-enUS, Grail-Quests-enUS, Grail-Reputations, Grail-Reputations-retail, Grail-Rewards, Grail-When, GroupfinderFlags, HandyNotes, HandyNotes_Argus, HandyNotes_AzerothsTopTunes, HandyNotes_BattleForAzerothTreasures, HandyNotes_BrokenShore, HandyNotes_DraenorTreasures, HandyNotes_DungeonLocations, HandyNotes_HallowsEnd, HandyNotes_HigherLearning, HandyNotes_LegionClassOrderHalls, HandyNotes_LegionTreasures, HandyNotes_LostAndFound, HandyNotes_LunarFestival, HandyNotes_MistsOfPandariaTreasures, HandyNotes_Shadowlands, HandyNotes_SummerFestival, HandyNotes_TravelGuide, HandyNotes_TreasureHunter, HandyNotes_WarfrontRares, HandyNotes_WellRead, Hekili, Immersion, InProgressMissions, InstanceAchievementTracker, InstancePortals, ItemLinkLevel, Kui_Media, Kui_Nameplates, Kui_Nameplates_Core, Kui_Nameplates_Core_Config, LFRtools, LegionInvasionTimer, LegionInvasionTimer_Options, LegionWardrobe, LegionWardrobeData, LibGetFrame-1.0, LibGroupInSpecT-1.1, LookingForSatchels, MBB, MRT, MasterPlan, MasterPlanA, MinimalArchaeology, MissingFlightPaths, MogIt, MogIt_Artifact, MogIt_Boutique, MogIt_Cloth, MogIt_Highlighter, MogIt_Leather, MogIt_Mail, MogIt_OneHanded, MogIt_Other, MogIt_Plate, MogIt_Ranged, MogIt_SetTransmog, MogIt_TwoHanded, MogIt_Wardrobe, MogIt_WowHead, MountFarmHelper, MythicDungeonTools, NomiCakes, Oilvl, Oilvl.zip, Pawn, PepeCollection, PetFarmHelper, PetFarmHelper.patch, Plater, Postal, Postal.patch, QE-DungeonTips, RaidAchievement, RaidAchievement_CataHeroics, RaidAchievement_CataRaids, RaidAchievement_Icecrown, RaidAchievement_LegionHeroics, RaidAchievement_LegionRaids, RaidAchievement_Naxxramas, RaidAchievement_OldModules, RaidAchievement_PandaHeroics, RaidAchievement_PandaRaids, RaidAchievement_PandaScenarios, RaidAchievement_Ulduar, RaidAchievement_WoDHeroics, RaidAchievement_WoDRaids, RaidAchievement_WotlkHeroics, RaiderIO, RaiderIO_DB_US_F, RaiderIO_DB_US_M, RaiderIO_DB_US_R, Rarity, Rarity_Options, Rematch, SavedInstances, Scrap, Scrap_Config, Scrap_Merchant, Scrap_Options, Scrap_Spotlight, Scrap_Visualizer, SimpleObjectiveProgress, Simulationcraft, Skada, SmexyMats, SoulshapeJournal, Stubby, Telemancy, TheUndermineJournal, TomCats, TomTom, TomeOfIllusionsCheck, TransmogTokens, VenturePlan, WardrobeSort, WardrobeSortData, WeakAuras, WeakAurasArchive, WeakAurasCompanion, WeakAurasModelPaths, WeakAurasOptions, WeakAurasTemplates, WhoLusted, Wholly, WorldFlightMap, WorldQuestsList, bobFastLoot, mOnArs_WardrobeHelper

commented

Commenting out LibSearchItem's odd "every event" item lookup seems to have helped for me. Changed to:

--	Lib.Scanner:SetScript('OnEvent', function()
--		Lib.Filters.tipPhrases.keywords[FOLLOWERLIST_LABEL_CHAMPIONS:lower()] = Lib:TooltipLine('item:147556', 2)
--		Lib.Filters.tipPhrases.keywords[GARRISON_FOLLOWERS:lower()] = Lib:TooltipLine('item:147556', 2)
--	end)

can confirm this

with commenting out = no delay, instant startup
without commenting out = 5-15 sec delay on startup (depending on char)

commented

This is really interesting. Especially since it's used in Bagnon. I suppose a ticket should be filed with Jail/Tuller on the Bagnon Github about this. Though I will admit it's a little concerning he hasn't updated the addon since October. Especially with Dragonflight around the corner.
https://github.com/tullamods/Bagnon/issues

LibItemSearch is part of Jailborc Wildpants library collection (originally created by Tuller)
https://github.com/Jaliborc/LibItemSearch-1.2

What I can do is try to disable it through code. If possible could you guys please post a ticket under Bagnon (link above) describing the issue? That way he knows and can work on it. In the meantime I'll see about putting a temporary fix on my end.
Thanks @greerga and @exscorp

commented

On a side note, I'm curious as to how you figured out it was those particular lines @greerga ? ๐Ÿ˜„ It's just my curiosity as it would be fascinating to find out how it was tracked down. Hehe ๐Ÿ˜ƒ Was this posted somewhere else or suggested by someone? Did you painstaking go line by line on your addons until you found it? Or did you do a general search for OnEvent checks?

commented

tHIS

This is really interesting. Especially since it's used in Bagnon. I suppose a ticket should be filed with Jail/Tuller on the Bagnon Github about this. Though I will admit it's a little concerning he hasn't updated the addon since October. Especially with Dragonflight around the corner. https://github.com/tullamods/Bagnon/issues

LibItemSearch is part of Jailborc Wildpants library collection (originally created by Tuller) https://github.com/Jaliborc/LibItemSearch-1.2

What I can do is try to disable it through code. If possible could you guys please post a ticket under Bagnon (link above) describing the issue? That way he knows and can work on it. In the meantime I'll see about putting a temporary fix on my end. Thanks @greerga and @exscorp

At the moment Bagnon is not usable (at least for me and several other people) since you can not longer open any bag if it's enabled... :-o

commented

On a side note, I'm curious as to how you figured out it was those particular lines @greerga ? ๐Ÿ˜„ It's just my curiosity as it would be fascinating to find out how it was tracked down. Hehe ๐Ÿ˜ƒ Was this posted somewhere else or suggested by someone? Did you painstaking go line by line on your addons until you found it? Or did you do a general search for OnEvent checks?

I've been troubleshooting this on and off for a week or so. My first attempts revolved around sprinkling default chat frame messages throughout the start-up code in BagSync like "Scanner:StartupScans", or the currency scan which had a suspicious if exitCount >= 50 then check, or the battle pet code that you were making change-log entries about being slow, but none of that bore fruit as being the cause.

After seeing this GitHub issue I tried a more "brute force" approach which combined adding default chat frame messages to every function (perl -i -pe 's/(function ([\w:]+).*)\n/$1\n\tDEFAULT_CHAT_FRAME:AddMessage("$2")\n/;' $(find BagSync -name \*.lua) except for AceConfigCmd-3.0:function print) and typing /etrace really quickly on login before the freeze (that I had noticed from your comments in the code).

That didn't solve the issue directly because there were so many thousands of item information received events and chat frame messages that I could see where it froze but couldn't save the messages immediately after the freeze because they scrolled beyond both chat and event history by then, and where it did pause was just Lib:TooltipLine. But I did notice that after the freeze was over I was still getting a lot of Lib:TooltipLine debug messages in the chat frame, even when I wasn't doing anything in-game. So I edited the default chat frame message already in that function in LibItemSearch to also log the item link and line and prepend a timestamp (date("%Y-%m-%d %H:%M:%S")).

From that I noticed the spam of messages was dozens per second and they were always looking up item 147556. So I used WowHead's website to craft a URL with that item ID (https://www.wowhead.com/item= 147556) and determined it was the Cloak of Concealment. While I probably do have such an item on my main character, it is in the bank and there's no reason it should be looked up dozens of times per second, so I searched the BagSync source code for that item number and found it referenced directly, which was somewhat unexpected.

I knew from the /etrace that thousands of events for item information received were generated at start-up so I figured that this OnEvent firing on all of those events and potentially doing another item lookup or two itself was at best a waste of effort and at worst causing infinite event loops or the event queue to overload. I also couldn't find any reason that lookup in every event was necessary or had any value at all, so I commented it out.

Afterward the on-login game freeze was over, so I tried putting the code back to verify the game froze again on login (it did), and then uncommented it and called it a success.

commented

On a side note, I'm curious as to how you figured out it was those particular lines @greerga ? ๐Ÿ˜„ It's just my curiosity as it would be fascinating to find out how it was tracked down. Hehe ๐Ÿ˜ƒ Was this posted somewhere else or suggested by someone? Did you painstaking go line by line on your addons until you found it? Or did you do a general search for OnEvent checks?

I've been troubleshooting this on and off for a week or so. My first attempts revolved around sprinkling default chat frame messages throughout the start-up code in BagSync like "Scanner:StartupScans", or the currency scan which had a suspicious if exitCount >= 50 then check, or the battle pet code that you were making change-log entries about being slow, but none of that bore fruit as being the cause.

After seeing this GitHub issue I tried a more "brute force" approach which combined adding default chat frame messages to every function (perl -i -pe 's/(function ([\w:]+).*)\n/$1\n\tDEFAULT_CHAT_FRAME:AddMessage("$2")\n/;' $(find BagSync -name \*.lua) except for AceConfigCmd-3.0:function print) and typing /etrace really quickly on login before the freeze (that I had noticed from your comments in the code).

That didn't solve the issue directly because there were so many thousands of item information received events and chat frame messages that I could see where it froze but couldn't save the messages immediately after the freeze because they scrolled beyond both chat and event history by then, and where it did pause was just Lib:TooltipLine. But I did notice that after the freeze was over I was still getting a lot of Lib:TooltipLine debug messages in the chat frame, even when I wasn't doing anything in-game. So I edited the default chat frame message already in that function in LibItemSearch to also log the item link and line and prepend a timestamp (date("%Y-%m-%d %H:%M:%S")).

From that I noticed the spam of messages was dozens per second and they were always looking up item 147556. So I used WowHead's website to craft a URL with that item ID (https://www.wowhead.com/item= 147556) and determined it was the Cloak of Concealment. While I probably do have such an item on my main character, it is in the bank and there's no reason it should be looked up dozens of times per second, so I searched the BagSync source code for that item number and found it referenced directly, which was somewhat unexpected.

I knew from the /etrace that thousands of events for item information received were generated at start-up so I figured that this OnEvent firing on all of those events and potentially doing another item lookup or two itself was at best a waste of effort and at worst causing infinite event loops or the event queue to overload. I also couldn't find any reason that lookup in every event was necessary or had any value at all, so I commented it out.

Afterward the on-login game freeze was over, so I tried putting the code back to verify the game froze again on login (it did), and then uncommented it and called it a success.

I will admit this is a meticulous and ingenious way to track down the issue. Top marks for tracking down the problem by using a combination of print methods and event tracing. ๐Ÿ˜„ I've done a little testing myself and it appears that the OnEvent is triggered a ridiculous amount of times, depending on combination of addons and standard login procedures by Blizzarrd. Though it is puzzling as the OnEvent should only be firing for GET_ITEM_INFO_RECEIVED. Yet there must be some sort of processing down on Blizzard end that is firing the GET_ITEM_INFO_RECEIVED event a crazy amount of times. Add to that the fact that the library is searching the tooltip lines multiple times with each call, could potentially cause a performance drop. I'm at a loss as to why it was done this way but I'm sure there is a reasoning behind it.

I have taken some measure on my end and have also done a parse of the startup procedures for BagSync. With specific addons it appears that BAG_UPDATE and UNIT_INVENTORY_CHANGED are triggered quite a number of times during startup. In addition Blizzard seems to SPAM both events like crazy when logging in. So in an effort to to alleviate some of this spam parsing, I have delayed the registering of the events and the startup scan for a few seconds to allow other addons and Blizzard code to breath a bit before BagSync does the initial bag and equipment scan. I have tested it numerous times and it seems to have done the job, scanning the bags only once. To prevent possible spam of the StartupScans, I have added failsafe's to make sure it only ever gets run once per login or reload.

In terms of Scanner:SaveCurrency() and if exitCount >= 50 then that is just my paranoia when it comes to endless loops. ๐Ÿคฃ Sorry about that! I have this big thing about WHILE loops because of my past with them. Suffice to say, I've had my fair share of endless loops. So I always built in exit clauses or escape plans to potentially prevent those things from happening whenever I use while loops. That particular function should only really loop at most 1 to 3 times depending on how many unexpanded categories a user has. Blizzard doesn't have more than 4 categories and it should NEVER reach 50. BUT JUST IN CASE... I built in an escape clause to prevent endless loop. Call it a programmers paranoid habit. ๐Ÿ˜„

Thank you SO much for taking the time to write that up and speak to me on it. I really do appreciate it and I LOVE when users interact with me to get things resolved. It's fun challenge and really does help me get their perspective as well as work on fixing the issue. You rock! ๐Ÿ’š