Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
169 stars 7 forks source link

`C_ContentTracking.StartTracking` is able to track completed achievements #550

Open Nercus opened 7 months ago

Nercus commented 7 months ago

Using C_ContentTracking.StartTracking on completed achievements sets them to be tracked, but they are not shown in the objective tracker. With the limit of 10 tracked achievements at the same time, it is possible to soft-lock the objective tracker. As tracked achievements are also stored between sessions, this problem persists (if caused by an addon) even after removing the addon. The only way to remove tracked completed achievements is with C_ContentTracking.StopTracking.

Edit: Currently only tested on retail!

p3lim commented 2 weeks ago

Can confirm, even without addons that deal with achievement tracking (I don't use anything like that). Achievements that have been manually tracked and then completed can sometimes get stuck in the API and considered tracked forever, even though the tracking UI doesn't show them.

A workaround is to iterate over them (e.g. on every login) and manually untrack achievements that have been completed:

local f = CreateFrame('Frame')
f:RegisterEvent('PLAYER_ENTERING_WORLD')
f:SetScript('OnEvent', function(_, event)
  for _, achievementID in next, C_ContentTracking.GetTrackedIDs(Enum.ContentTrackingType.Achievement) do
    local _, name, _, completed = GetAchievementInfo(achievementID)
    if completed then
      print('Untracking completed achievement "' .. name .. '" (' .. achievementID .. ') that got stuck')
      C_ContentTracking.StopTracking(Enum.ContentTrackingType.Achievement, achievementID, Enum.ContentTrackingStopType.Manual)
    end
  end

  f:UnregisterEvent(event)
end)