Skip to content

fix: add message queue with retry for addon sync in Interrupts and De…#26

Merged
loicngr merged 1 commit intomainfrom
fix/sync-message-queue
Mar 28, 2026
Merged

fix: add message queue with retry for addon sync in Interrupts and De…#26
loicngr merged 1 commit intomainfrom
fix/sync-message-queue

Conversation

@loicngr
Copy link
Copy Markdown
Owner

@loicngr loicngr commented Mar 28, 2026

In WoW 12.0 (Midnight), SendAddonMessage can return AddOnMessageLockdown or AddonMessageThrottle during instanced combat, silently dropping messages. SYNC messages survive because the heartbeat fires between pulls, but USED messages (sent during combat) are lost.

Changes:

  • Replace fire-and-forget safeSend with queue + retry system in both addons
  • Check SendAddonMessage return value; queue failed messages
  • OnUpdate ticker only runs when queue is non-empty (start/stop pattern)
  • Retry queued messages every 1s, discard after 30s
  • Separate expiry pruning from send pass in flushQueue
  • Include GetServerTime() timestamp in USED messages so receivers can adjust cooldown remaining for delivery delay
  • Always update charge state even when remaining <= 0 (Defensives)
  • Remove pcall wrapping (API returns error codes, not exceptions)
  • Remove spurious early-return guard in Defensives ModernDefensivesDisplay
  • Localize table.remove for hot-path usage
  • Backward-compatible: receivers handle both old (no timestamp) and new formats
  • Bump Interrupts to 2.2.0, Defensives to 2.2.0

…fensives

In WoW 12.0 (Midnight), SendAddonMessage can return AddOnMessageLockdown
or AddonMessageThrottle during instanced combat, silently dropping messages.
SYNC messages survive because the heartbeat fires between pulls, but USED
messages (sent during combat) are lost.

Changes:
- Replace fire-and-forget safeSend with queue + retry system in both addons
- Check SendAddonMessage return value; queue failed messages
- OnUpdate ticker only runs when queue is non-empty (start/stop pattern)
- Retry queued messages every 1s, discard after 30s
- Separate expiry pruning from send pass in flushQueue
- Include GetServerTime() timestamp in USED messages so receivers can
  adjust cooldown remaining for delivery delay
- Always update charge state even when remaining <= 0 (Defensives)
- Remove pcall wrapping (API returns error codes, not exceptions)
- Remove spurious early-return guard in Defensives ModernDefensivesDisplay
- Localize table.remove for hot-path usage
- Backward-compatible: receivers handle both old (no timestamp) and new formats
- Bump Interrupts to 2.2.0, Defensives to 2.2.0
@loicngr loicngr self-assigned this Mar 28, 2026
@loicngr loicngr merged commit f734453 into main Mar 28, 2026
1 check passed
@loicngr loicngr deleted the fix/sync-message-queue branch March 28, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant