-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unwatch no longer logs a warning and idempotent behavior clarified #1018
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1018 +/- ##
==========================================
- Coverage 87.27% 87.04% -0.23%
==========================================
Files 9 9
Lines 4936 4941 +5
==========================================
- Hits 4308 4301 -7
- Misses 628 640 +12 ☔ View full report in Codecov by Sentry. |
@jlstevens I believe you're the last person who refactored |
After thinking about this, I think raising a
I believe the original intent was to make unwatching idempotent: if you ask for something to be unwatched and it exits, it gets unwatched. If it is not being watched already, then there is nothing to do. I see arguments either way and I don't mind this behavior being deprecated, but not this suddenly. |
Thanks for the review @jlstevens, beneficial insights. After giving it some more thought, I decided it was best to stay closer to the current implementation that aims to be idempotent. I say "aim" as it is not truly idempotent imo as it logs a warning when the watcher has already been removed. I agree there are situations in an app, even more so when it's async based, where unwatching can happen multiple times or in a non-specific order. FWIW what also pushed me to change things was that the try/except was just catching With 016b675:
@jlstevens could you please review again? |
Resolves #1003
By raising
ValueError
when trying to remove an already removed/never registered watcher.