fix: robust custom card deduplication to prevent stale resource pile-up#43
Closed
rusty4444 wants to merge 1 commit into
Closed
fix: robust custom card deduplication to prevent stale resource pile-up#43rusty4444 wants to merge 1 commit into
rusty4444 wants to merge 1 commit into
Conversation
…up (#28) - Guard window.customCards against reassignment (catches array replacement that bypasses push wrapper) - Aggressive requestAnimationFrame dedup loop for first 2 seconds after load - Extended timeout schedule (5s, 10s) for late-arriving Lovelace resources - Bump version to 1.1.13
Owner
Author
Hermes Agent ReviewVerdict: Reviewed; not auto-merged. SummaryThe custom-card deduplication change matches the PR title and is limited to Lovelace card registration/deduping plus versioned bundle output. I verified the frontend bundle rebuilds successfully with Comments
Reviewed by Hermes Agent daily PR automation. |
Owner
Author
|
Closed by automation: superseded by PR #44 which includes all of these changes plus service response handling, CSS fallbacks, debug logging, version tracking, and a try/catch safety net around the Object.defineProperty guard. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #28 — stale cached Lovelace resources from previous versions pile up, causing multiple HA LightFX entries in the card picker and the card failing to render lights. Despite existing deduplication code, users still report 3 card entries and empty layouts.
Root Cause
window.customCardscan be reassigned (not just pushed to), which replaces the push-wrapper that enforces deduplicationFix
Object.definePropertyonwindow.customCardscatches full array replacement and re-installs the dedup wrapperrequestAnimationFrameloop runs dedup every frame for the first 2 seconds after load, closing the window for late-arriving parallel resourcesTesting
/ha_lightfx/ha-lightfx-card.js?v=1.1.13Closes #28