fix(libs): degrade gracefully on over-long AceComm prefix (#12)
A third-party addon (e.g. AtlasLoot) registers an AceComm prefix longer than the client's 16-character limit. Because Questie's bundled AceComm is the LibStub winner and its xpcall polyfill wraps AceAddon's OnEnable, the upstream hard error() in RegisterComm surfaced as a recurring Lua error at every login (seen on ChromieCraft). The prefix can never work on the client regardless, so RegisterComm now warns once and skips the registration for over-long prefixes instead of throwing, leaving the calling addon's OnEnable intact and removing the error popup.
This commit is contained in:
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
|
- **[Libs/AceComm - Long Comm Prefix Login Error]** (#12) Fixed a recurring login Lua error `AceComm:RegisterComm(...): prefix length is limited to 16 characters` on servers like ChromieCraft. The cause is a third-party addon (e.g. AtlasLoot) registering an AceComm prefix longer than the client's 16-character limit; because Questie's bundled AceComm is the LibStub winner and its `xpcall` polyfill wraps AceAddon's `OnEnable`, the upstream hard `error()` surfaced through Questie's frames every login. Our bundled `AceComm:RegisterComm` now degrades gracefully for over-long prefixes (which can never work on the client anyway): it warns once and skips the registration instead of throwing, so the offending addon's `OnEnable` is no longer aborted and the error popup is gone.
|
||||||
- **[Tracker - VoiceOver questPlayButtons Nil Crash]** (#15) Fixed `attempt to index field 'questPlayButtons' (a nil value)` in `TrackerUtils:UpdateVoiceOverPlayButtons` and `TrackerLinePool.SetAllPlayButtonAlpha`. `TrackerUtils:IsVoiceOverLoaded` only checked that the VoiceOver addons were loaded, but some VoiceOver builds (seen on Elune) expose a `QuestOverlayUI` without a `questPlayButtons` table. It now also verifies `VoiceOver.QuestOverlayUI.questPlayButtons` exists; since every play-button call site gates on this function, the integration is now safely skipped instead of crashing on those builds.
|
- **[Tracker - VoiceOver questPlayButtons Nil Crash]** (#15) Fixed `attempt to index field 'questPlayButtons' (a nil value)` in `TrackerUtils:UpdateVoiceOverPlayButtons` and `TrackerLinePool.SetAllPlayButtonAlpha`. `TrackerUtils:IsVoiceOverLoaded` only checked that the VoiceOver addons were loaded, but some VoiceOver builds (seen on Elune) expose a `QuestOverlayUI` without a `questPlayButtons` table. It now also verifies `VoiceOver.QuestOverlayUI.questPlayButtons` exists; since every play-button call site gates on this function, the integration is now safely skipped instead of crashing on those builds.
|
||||||
- **[Libs/AceGUI - Tree Tooltip Nil Crash]** (#15) Hardened `AceGUIContainer-TreeGroup` against `attempt to index ... 'tooltip' (a nil value)` when a conflicting addon registers a broken `AceGUI-3.0` core (observed in the wild as version `1.#INF`) that wins LibStub but never creates the shared `AceGUI.tooltip` frame. The tree button enter/leave handlers now lazily (re)create the tooltip frame; the widget version was bumped 47→48 so the fixed widget wins registration over an unpatched same-version copy.
|
- **[Libs/AceGUI - Tree Tooltip Nil Crash]** (#15) Hardened `AceGUIContainer-TreeGroup` against `attempt to index ... 'tooltip' (a nil value)` when a conflicting addon registers a broken `AceGUI-3.0` core (observed in the wild as version `1.#INF`) that wins LibStub but never creates the shared `AceGUI.tooltip` frame. The tree button enter/leave handlers now lazily (re)create the tooltip frame; the widget version was bumped 47→48 so the fixed widget wins registration over an unpatched same-version copy.
|
||||||
- **[Tooltip - Learner Spawn Data Never In Main Tooltip]** Learner spawn/kill data is no longer added inline to the main NPC tooltip under any setting. Previously, with the "Use secondary learner tooltip" option off, `_AddLearnedSpawnTooltipLine` appended the lines directly to `GameTooltip`. The toggle now gates the data entirely: on = shown in the separate secondary frame, off = not shown anywhere. Removed the now-unused `_AddTooltipSeparator` helper and updated the option description. (Complements the earlier System A suppression that kept the duplicate learner lines out of the main tooltip.)
|
- **[Tooltip - Learner Spawn Data Never In Main Tooltip]** Learner spawn/kill data is no longer added inline to the main NPC tooltip under any setting. Previously, with the "Use secondary learner tooltip" option off, `_AddLearnedSpawnTooltipLine` appended the lines directly to `GameTooltip`. The toggle now gates the data entirely: on = shown in the separate secondary frame, off = not shown anywhere. Removed the now-unused `_AddTooltipSeparator` helper and updated the option description. (Complements the earlier System A suppression that kept the duplicate learner lines out of the main tooltip.)
|
||||||
|
|||||||
@@ -53,13 +53,27 @@ AceComm.multipart_spool = AceComm.multipart_spool or {}
|
|||||||
--- Register for Addon Traffic on a specified prefix
|
--- Register for Addon Traffic on a specified prefix
|
||||||
-- @param prefix A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent), max 16 characters
|
-- @param prefix A printable character (\032-\255) classification of the message (typically AddonName or AddonNameEvent), max 16 characters
|
||||||
-- @param method Callback to call on message reception: Function reference, or method name (string) to call on self. Defaults to "OnCommReceived"
|
-- @param method Callback to call on message reception: Function reference, or method name (string) to call on self. Defaults to "OnCommReceived"
|
||||||
|
local _warnedLongPrefix = {}
|
||||||
|
|
||||||
function AceComm:RegisterComm(prefix, method)
|
function AceComm:RegisterComm(prefix, method)
|
||||||
if method == nil then
|
if method == nil then
|
||||||
method = "OnCommReceived"
|
method = "OnCommReceived"
|
||||||
end
|
end
|
||||||
|
|
||||||
if #prefix > 16 then -- TODO: 15?
|
if #prefix > 16 then -- 16 char limit imposed by the client (RegisterAddonMessagePrefix)
|
||||||
error("AceComm:RegisterComm(prefix,method): prefix length is limited to 16 characters")
|
-- Some third-party addons (e.g. AtlasLoot) call RegisterComm with a prefix longer
|
||||||
|
-- than the client's 16-character limit. Upstream AceComm hard-errors here, which --
|
||||||
|
-- because this is the LibStub-winning AceComm and Questie's xpcall polyfill wraps
|
||||||
|
-- AceAddon's OnEnable -- surfaces as a recurring Lua error at every login. The prefix
|
||||||
|
-- can never work on this client regardless, so degrade gracefully: warn once and skip
|
||||||
|
-- the registration instead of aborting the calling addon's OnEnable.
|
||||||
|
if not _warnedLongPrefix[prefix] then
|
||||||
|
_warnedLongPrefix[prefix] = true
|
||||||
|
if DEFAULT_CHAT_FRAME then
|
||||||
|
DEFAULT_CHAT_FRAME:AddMessage("|cffff8000AceComm:|r ignoring comm prefix longer than 16 characters: '" .. tostring(prefix) .. "'")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return
|
||||||
end
|
end
|
||||||
if C_ChatInfo then
|
if C_ChatInfo then
|
||||||
C_ChatInfo.RegisterAddonMessagePrefix(prefix)
|
C_ChatInfo.RegisterAddonMessagePrefix(prefix)
|
||||||
|
|||||||
Reference in New Issue
Block a user