Unsafe to show dialogs inside the field_filter hook?

I have an add-on that shows an error message using showWarning inside a callback registered with the field_filter hook. I found out that this sometimes causes Anki to enter an infinite loop where dismissing the error dialog will make Anki reevaluate custom filters again (caused by a refresh_if_needed call) and will eventually result in the same error dialog being shown.

Should this be documented (maybe in genhooks.py)?

I suspect it’s not something people are going to attempt that frequently, but if you think it should be mentioned in the docstring of the hook, no objections from me :slight_smile:

1 Like

I agree.
I think I’ll just use a tooltip here.