Division by zero sometimes occurs in GUI Update functions
rdw-software opened this issue ยท 3 comments
Initially reported here - could not reproduce. Despite the error message, this likely is not related to the addon, "Professor" at all. Slightly different error but apparently the same issue was reported shortly afterwards here.
- Figure out steps to reproduce (error is caused by / 0 - but why does that happen? -> artifactTier taking on invalid values causes this)
- Add workaround (prevent division by zero - simple enough) -> Set tier = 2 if the returned value is too high
- Fix whatever is causing the API to return absurd numbers or simply ignore it if is intended behaviour (Netherlight Crucible?)
Maybe something changed in 7.3? Haven't seen the error before and I didn't play (enough) to see for myself. Must... investigate...
Clearly caused by the artifact tier being set to absurdly high numbers, which - oddly enough - are different for each class, and only occur for certain specs? Something must've happened in 7.3 to cause this behaviour, as it never occured before.
It has happened for different users on different classes, too:
- Shaman: artifactTier = 1533 for spec 3 (Restoration)
- Death Knight: artifactTier = 1513 for spec 2 (Frost)
- Druid: artifactTier = 668 for spec 1 (Balance)
I could add a workaround ASAP but that'd simply break those specs entirely (or at least may cause additional issues)? Maybe it'll work to just set the tier to 2 for everybody in 7.3, as tier 1 is no longer obtainable and the API apparently does not work with those higher numbers either.
Added workaround in 910b103.
This should fix the errors, but the issue itself still needs to be investigated as it might affect other parts of the addon (and also, it's just plain weird).
Should be fixed in 6d87a53 - I still don't know why it is happening but it may just be a bug in Blizzard's API.
The second part to the fix repairs the Cache validation routine, allowing it to successfully purge the invalid artifactTier entries saved before the first part was rolled out and restore functionality for everybody affected by the bug... or so I hope >_>