Critical-Impact / InventoryTools

Dalamud plugin for inventory tracking
GNU General Public License v3.0
41 stars 28 forks source link

Crash when using Patch field in Search Filters #225

Closed apetih closed 1 year ago

apetih commented 1 year ago

Describe the bug When opening a search filter tab that has a value assigned in the Patch field, or simply creating a new search filter with said field filled, Dalamud throws an internal error that causes the game to close.

To Reproduce Steps to reproduce the behavior:

  1. Create new Search Filter and add it to the Tab List.
  2. Fill out the Patch field in Basic tab of the configuration window with any patch number, in my case issue was caused while using 4.2.
  3. Add inventory sources in Inventories tab.
  4. Click on the newly created filter's tab in the Tab List.

Expected behavior Not to crash, and to filter items by specified patch number.

Screenshots image

System.ArgumentException: An item with the same key has already been added. Key: 36861
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at LuminaSupplemental.Excel.Model.ItemPatch.ToItemLookup(List`1 itemPatches) in /work/repo/LuminaSupplemental/src/LuminaSupplemental.Excel/Model/ItemPatch.cs:line 65
   at CriticalCommonLib.Services.ExcelCache.GetItemPatch(UInt32 itemId) in /work/repo/CriticalCommonLib/Services/ExcelCache.cs:line 482
   at InventoryTools.Logic.Filters.PatchFilter.FilterItem(FilterConfiguration configuration, ItemEx item) in /work/repo/InventoryTools/Logic/Filters/PatchFilter.cs:line 27
   at InventoryTools.Logic.FilterConfiguration.FilterItem(InventoryItem item) in /work/repo/InventoryTools/Logic/FilterConfiguration.cs:line 1210
   at InventoryTools.Logic.FilterConfiguration.GenerateFilteredListInternal(FilterConfiguration filter, List`1 inventories) in /work/repo/InventoryTools/Logic/FilterConfiguration.cs:line 2829
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at InventoryTools.Logic.FilterConfiguration.StartRefresh() in /work/repo/InventoryTools/Logic/FilterConfiguration.cs:line 293
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.QueueUserWorkItemCallback.Execute()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

Dalamud Information: Do you have testing enabled? Yes

Filter Issues Here is a filter configuration export with which the issue arises.

H4sIAAAAAAAACn1W227jNhBF/2TBZ2NhXRxf3hInWxtN4k2cNO0GfaClsU2UJrUUlcAN8u8dihItWdQ+GJbO4dzIM0P99kGe6IbDMiUzEl/Eo1GUpMEomsRxkE7CId0EF3FAJzSeJJQMyFzRrT5ZBJNgEwcTCIfjKA430WYapHG4TcZhlFwkwwlaLNhuz/Gn72QKZDYckLUsVAJL8QZCS8UgJ7PXfwZkqeHwzOZUw06qo3Ffo2ugKtmfMzc/C5atudTnRJneAkxMMgvjZtIddAE0BTWXHHMisw/yF2b4FXP82/zH0XRAfpBZYJCX8v+zykiqTthryDUTVDMpurXli59kJgrOzTOG45BohgnV4D094DO5h/cvttov3xjXoHADr4uMswSD5SvBj7WBpU0u+VI8gqZMgMJov2JvRHHAKtAlyzNOj0uBm4I2WhUwIKsMxGX+wkQq38lsS3mO4ENBhWYawxJMZXkLb8Dt8zpjiumNFKl9NxVUOZfv9vnpmEEZ8g8wPuhmut2Eo2BKx+N4GtHNCNJocjHcTqNROoojUqvjkvNGUVUyjlrIIgdXrIO/KYC5PGRUsBPr9PeyB1GDzzmsHm2GTOw6juZ7qmiCpNucxuG2U7OWbdqbR3uJr4KlSHiRwlzJPHcZeBLoWVedPMb+D6Pz4iDyM9AI/oxpuK30zM7T6uLtUpqbVdntZbYGznFrvyuWGGETi14VxzZ4R9W/oC/fQNEddPAnqSnvknMqruBKFmUr1011+UYZNz1+qZ/YAdL7ctxYdvWOh2X6FPt4mUjR0YYZAMpTnn9Bffy3LG8T2E5+CzMQlHZcQ3OW8YXsLGp6b5AOazj5FXdzyEw/V553QipYPJjmMEOt4beUiynxGra04PrUhuyQcasmXG7HelMwL1Lx1ImhXFcNHHcFOBW+ludhX6sh4l7M7HAv9SByQCXO+vVWJlbFFsCZ65P7lZQcqLCdj+gHzvPyoFrIWpupcILq6YxhvlOd7N2Yi7+GxNwIAjsE2j6uIWEHylvYMxO6A8z3EoXdhrkUOw9u8/IQ7qhMsguWltOHgwZ3ZrVk8R87+Q1WCq89exTG9oymOON7qVWhs0KXQ31eKAUiOf6uZIEdr618Sstjjq3bwb8rSIzTNoGeblDgR73H1xvMt2NXp92xK+fon4B3lmquXzw8An4eKEjdDlRyKPcFdeKkuBQ7XMbwvsbktmDqAaO8aodeP8oLPyCzkb36Q6ulz4EjMA0/EfYRUR8x6SPi3uD9jCnOz/TGD3pTnvaa9JY/dkSI300+OPDDoR+e+GH8mph6mSiaBlGPTTgc9trEDeait+xeOYzbBE6iH1LASVy1sOoRVX6lVZ+JHi02W7zTixVpAhg3HStD4J3rxe/kxr8eL13RY8JEeX37c0tY1iiz4k6dWAKIVPVPP/8HYzSxz3wMAAA=

Additional context Unsure if the crash also happens when no items are found matching the search filter or when items are found on only a single inventory. In my case, the filtered items are found on multiple characters.

Critical-Impact commented 1 year ago

Hi, I have a patch going out for this that is currently waiting in the dalamud queue, I'll close this issue as I am very sure it will fix it. Please reopen if once it's out it does not sort you out :)