Lighthouse Card not hidden when annotation removed from catalog entity
See original GitHub issueExpected Behavior
When removing a Lighthouse annotation from a catalog entity, that entity is no longer registered with lighthouse.
Current Behavior
My component had a test annotation of:
annotations:
lighthouse.com/website-url: https://spotify.com
Note I did not actually run spotify.com through my Lighthouse instance, so it’s NOT in the Lighthouse database. I ended up removing that annotation from catalog-info.yaml. I waited for the refresh, but also forcibly re-registered the component. But now every time I visit the overview page, the Lighthouse card displays (which it now should not) and it also errors out with:

Because I never actually ran an audit for that site. But I believe the error msg is just an effect of the root cause being my component still thinks it has a Lighthouse annotation (when it doesn’t).
Possible Solution
…
Steps to Reproduce
- Install Lighthouse plugin
- Add a Lighthouse annotation to a component pointing to any fake web site (no need to actually run an audit against it!)
- Remove the Lighthouse annotation
- See that Lighthouse card is still visible on the entity
I have a feeling the edge case here is an audit website (annotation value) that never exists, maybe somehow doesn’t let it get unregistered full??
Context
I just added this annotation as a test, but seems now I can’t remove it. I wondered if maybe I needed a hook to remove it from the plugin, however in this instance it must be the entity itself which believes the annotation still exists in the catalog, otherwise the card would never even TRY to loop. So I wonder if all annotations are somehow not cleaned up or orphaned in some way?
I’ve tried with other ones which DID exist with an audit, and they DO seem to remove. I’m still working out edge cases, but opening in case others saw similar or know any related issues.
Your Environment
- NodeJS Version (v12): 12
- Operating System and Version (e.g. Ubuntu 14.04): Windows 10 1909 WSL2 Ubuntu 18.04
- Browser Information: Microsoft Edge
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)

Top Related StackOverflow Question
Fix works like a charm, @freben thanks! Adding annotation, refresh picked it up. Removing annotation, refresh hid the card. Thanks for quick fix!! 🎉
PR is up