You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-ups from #7215: dead statement in test_reserved_mixin_var, typed _reflex_state_root default, document the type(rx.State) is BaseStateMeta contract #7264
Three follow-ups recorded in the #7215 review (reserved-name validation moved into BaseStateMeta.__new__), all out of scope for that PR:
tests/units/test_state.py::test_reserved_mixin_var[state_mixin=True] has a dead statement. For that parametrization the reserved name is rejected at the mixin's own declaration, so the second type("MixedState", …) statement never runs. Pre-existing since Validate reserved state names before registration #7136 (the test was moved verbatim). Restructure it so each parametrization asserts where the rejection happens.
Replace the getattr(base, "_reflex_state_root", None) lookup over the bases in BaseStateMeta.__new__ (packages/reflex-base/src/reflex_base/vars/base.py) with a typed metaclass default (_reflex_state_root: BaseStateMeta | None = None) and limit the lookup to the EvenMoreBasicBaseState bases. Removes the string literal and the getattr.
Three follow-ups recorded in the #7215 review (reserved-name validation moved into
BaseStateMeta.__new__), all out of scope for that PR:tests/units/test_state.py::test_reserved_mixin_var[state_mixin=True]has a dead statement. For that parametrization the reserved name is rejected at the mixin's own declaration, so the secondtype("MixedState", …)statement never runs. Pre-existing since Validate reserved state names before registration #7136 (the test was moved verbatim). Restructure it so each parametrization asserts where the rejection happens.getattr(base, "_reflex_state_root", None)lookup over the bases inBaseStateMeta.__new__(packages/reflex-base/src/reflex_base/vars/base.py) with a typed metaclass default (_reflex_state_root: BaseStateMeta | None = None) and limit the lookup to theEvenMoreBasicBaseStatebases. Removes the string literal and thegetattr.BaseStateMetadocstring:type(rx.State) is BaseStateMetais supported (downstream metaclasses derive from it; reflex-enterprise'sOIDCCookieMetadoes),state_root=andmixin=are class keywords the metaclass understands, and_reflex_state_rootis a reserved name. Its absence is what let 0.9.12a1 ship the sibling metaclass that caused 0.9.12a1: metaclass conflict for State subclasses using a BaseStateMeta-derived metaclass (breaks reflex-enterprise 0.9.5 auth/MCP/REST apps at startup) #7211.Source:
fixes/f001/REPORT.md, "PR review follow-ups", and the #7215 description.