MythicDungeonTools icon indicating copy to clipboard operation
MythicDungeonTools copied to clipboard

Bug: Importing Routes in MDT Doesn't Update Existing Routes

Open chatterchats opened this issue 4 months ago • 0 comments

Bug: Importing Routes in MDT Doesn't Update Existing Routes

Description

When importing a route in the Mythic Dungeon Tools (MDT) addon, it never prompts to update an existing route if the route already exists. Instead, it imports the route as a new one every time.

Steps to Reproduce

  1. Import a route in MDT.
  2. Attempt to import the same route again.
  3. Notice that instead of updating the existing route, a new duplicate route is created.

Expected Behavior

If a route already exists with the same name or unique identifier (UID), MDT should prompt to update the existing route rather than importing it as a new one.

Actual Behavior

MDT always imports the route as a new one, even if a duplicate route exists.

Cause

The issue seems to stem from the following code blocks in MythicDungeonTools.lua and Modules/Transmission.lua: https://github.com/Nnoggie/MythicDungeonTools/blob/2a08c9185d0998e149400a7b02a2c142eab63253/MythicDungeonTools.lua#L3057-L3062

https://github.com/Nnoggie/MythicDungeonTools/blob/2a08c9185d0998e149400a7b02a2c142eab63253/Modules/Transmission.lua#L767-L787

This logic always assigns a new unique ID (uid) during the first import. As a result, subsequent imports can never find a duplicate in the following check in MDT:ImportPreset():

https://github.com/Nnoggie/MythicDungeonTools/blob/2a08c9185d0998e149400a7b02a2c142eab63253/MythicDungeonTools.lua#L3017-L3023

Because a new uid is assigned, the duplicate detection mechanism fails, and the route is treated as a new one rather than updating the existing one.

Suggested Fix

Consider adjusting the logic to retain the uid when importing, so that subsequent imports can correctly identify and update the existing route.

Additional Information

  • MDT Version: 5.1.2 & (after updating) 5.1.5
  • WoW Version: 11.0.2
  • Addons Installed:
    • Custom AddOn I'm working on, that can batch import to MDT
    • ElvUI (with and without)
    • MDT

chatterchats avatar Oct 14 '24 16:10 chatterchats