Skip to content

Conversation

@tomdonaldson
Copy link
Collaborator

If there is no registered listener for the current_overlays event, then calling remove_overlay() results in a KeyError at ipyaladin:widget.py:269 because it tries to access the non-existent listener for current_overlays.

The current_overlays event also updates self._overlays and that should still happen regardless of whether a listener is registered, so the listener check should happen after that update.

A separate issue I noticed is that although self._overlays is updated on layer removal (via handleRemoveOverlay() calling handleGetOverlays() in message_handler.js), self._overlays is not updated when a layer is added. Those adds are not as centralized as removals. It's not clear whether it would be best to call the JS handleGetOverlays() on every sort of overlay add or to call the Python version in the relevant add methods.

@tomdonaldson tomdonaldson self-assigned this Sep 24, 2025
@tomdonaldson tomdonaldson merged commit 175bb40 into cpparts:dev_cobalt Sep 26, 2025
4 checks passed
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.

2 participants