Warn once about auto_memoize=False without react_compiler
Type of change
- Bug fix (non-breaking change which fixes an issue)
Description
Found in the reflex 0.11.0a1 pre-release testing (FINDING-047).
The config is built several times per run. The "auto_memoize=False without react_compiler=True" warning added in #7694 had no once-per-process guard, so REFLEX_AUTO_MEMOIZE=false REFLEX_REACT_COMPILER=false reflex compile logged it twice and reflex run five times.
This PR adds a _warned_auto_memoize module flag in reflex_base/config.py, the same guard the react_compiler warning has with _warned_react_compiler. I used a flag rather than extra={"dedupe": True} because the dedupe filter only applies in managed (CLI) mode.
Checked end to end on a scratch app: reflex compile with both env vars set prints the warning once.
Changes To Core Features:
- Have you added an explanation of what your changes do and why you'd like us to include them?
- Have you written new tests for your core changes, as applicable?
- Have you successfully ran tests with your changes locally?
tests/units/test_config.py::test_warns_when_all_memoization_is_disabled now builds the config twice and asserts exactly one warning. On main the two disabled/disabled cases fail with assert 2 == 1. test_config.py passes, and ruff, ruff format, pyright and pre-commit are clean on the changed files.
Generated by Claude Code