1. Hello!

    As part of a learning exercise I'm in the process of writing simple unit frames for my own use. I've noticed irregularities with regards to boss unit ids and the UNIT_HEALTH (and other) event/s.

    I'm using SecureUnitButtonTemplate for my unit frames which are handled by RegisterUnitWatch. This is working fine for "player", "target", "partyN", "raidN" and so on, but I've noticed that occasionally my frames won't trigger :Show() for "bossN". Also, UNIT_HEALTH doesn't consistently fire for "bossN" unit ids.

    To give some examples: Ultraxion's frame will not show up until he's actually attackable (Hiding/showing is handled by RegisterUnitWatch).

    Occasionally on the Yor'Sahj encounter only 1 or 2 globule frames will show, sometimes all 3.

    Health value changes for Deathwing during the "Spine of Deathwing" encounter always seem to get propagated too late (or too early) by UNIT_HEALTH.

    Taking a look at Blizzard's code it seems they're using OnUpdate to query health values for the default boss frames.

    Now here are my questions:

    Why is this behaviour so inconsistent for bossN unit ids? Is OnUpdate the only reliable solution? From what I gather RegisterUnitWatch runs UnitExists on its registered units every 0.2s. But seeing as some of my boss frames do not show up or show up after a delay, do I have to manually handle :Show() and :Hide() for boss frames? And if so, what's the correct way to go about handling unit-existence if UnitExists returns nil??

    Hello!

    As part of a learning exercise I'm in the process of writing simple unit frames for my own use. I've noticed irregularities with regards to boss unit ids and the UNIT_HEALTH (and other) event/s.

    I'm using SecureUnitButtonTemplate for my unit frames which are handled by RegisterUnitWatch. This is working fine for "player", "target", "partyN", "raidN" and so on, but I've noticed that occasionally my frames won't trigger :Show() for "bossN". Also, UNIT_HEALTH doesn't consistently fire for "bossN" unit ids.

    To give some examples: Ultraxion's frame will not show up until he's actually attackable (Hiding/showing is handled by RegisterUnitWatch).

    Occasionally on the Yor'Sahj encounter only 1 or 2 globule frames will show, sometimes all 3.

    Health value changes for Deathwing during the "Spine of Deathwing" encounter always seem to get propagated too late (or too early) by UNIT_HEALTH.

    Taking a look at Blizzard's code it seems they're using OnUpdate to query health values for the default boss frames.

    Now here are my questions:

    Why is this behaviour so inconsistent for bossN unit ids?

    I don't know, I didn't write the WoW client =) As far as things now showing up until after they're attackable, I'm fairly certain that's the behaviour of the default boss frames as well, but it's been a while since I used them.

    Is OnUpdate the only reliable solution?

    I would use whatever mechanism the Blizzard frames use, personally, since you have a reference implementation and can compare the behaviours.

    From what I gather RegisterUnitWatch runs UnitExists on its registered units every 0.2s. But seeing as some of my boss frames do not show up or show up after a delay, do I have to manually handle :Show() and :Hide() for boss frames? And if so, what's the correct way to go about handling unit-existence if UnitExists returns nil??

    I mean, it sounds like the code is doing exactly what you've told it to, based on the returns of UnitExists. If UnitExists returns nil, there isn't really anything you can do, since the APIs won't return anything meaningful for them.

    Thank you very much for your answer!

    After some more browsing around it would appear that the two other unit frame addons I've been looking at - oUF and Stuf - poll OnUpdate for health changes on boss frames too, so I'll go with that :)

    I will run with default boss frames next reset to make sure this is working as intended :p

    I'm just confused why events such as UNIT_HEALTH would pass "bossN" when they're not really meant to be used for boss unit ids in the first place.