Skip to content

fix: Fix emmision when signal disconnect itself#413

Open
Czaki wants to merge 8 commits intopyapp-kit:mainfrom
Czaki:fix_disconnect
Open

fix: Fix emmision when signal disconnect itself#413
Czaki wants to merge 8 commits intopyapp-kit:mainfrom
Czaki:fix_disconnect

Conversation

@Czaki
Copy link
Copy Markdown
Contributor

@Czaki Czaki commented Apr 21, 2026

I napari overlays we have a signal that need to disconnect itself (as it need to be executed only when event is first emited)

This PR is changing to not iterate over self._slots but list(self._slots) that means that disconnection during iteration is not skipping event just after disconnected one.

https://napari.zulipchat.com/#narrow/channel/212875-general/topic/Fix.20first.20.60visible.60.20event.20execution.20of.20overlays/with/588565203
closes napari/napari#8911
closes napari/napari#8910

The alternative might be to add an argument emmit_once to connect method.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.75%. Comparing base (1e90319) to head (409783b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #413   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files          23       23           
  Lines        2462     2462           
=======================================
  Hits         2456     2456           
  Misses          6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 21, 2026

Merging this PR will not alter performance

✅ 67 untouched benchmarks


Comparing Czaki:fix_disconnect (409783b) with main (1e90319)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Overlay visible event is consumed by disconnect call

1 participant