fix(types): skip ForwardRef resolution for unannotated attribute probes - #6929
fix(types): skip ForwardRef resolution for unannotated attribute probes#6929benedikt-bartscher wants to merge 3 commits into
Conversation
Greptile SummaryThis PR avoids resolving unrelated forward references during unannotated attribute probes and centralizes tolerant event-callback type-hint lookup.
Confidence Score: 4/5The PR is not yet safe to merge because the outstanding annotation-name cache can reject valid attributes after class annotations change. The cache snapshots annotation names without invalidation, while attribute access relies on that cached membership check before resolving hints; a later-added annotation can therefore still produce Files Needing Attention: packages/reflex-base/src/reflex_base/utils/compat.py and packages/reflex-base/src/reflex_base/utils/types.py
|
| Filename | Overview |
|---|---|
| packages/reflex-base/src/reflex_base/utils/compat.py | Adds cached MRO annotation-name discovery, but the cache still permanently misses annotations added after its first lookup. |
| packages/reflex-base/src/reflex_base/utils/types.py | Gates full type-hint resolution on declared annotation names to prevent unrelated forward-reference evaluation. |
| packages/reflex-base/src/reflex_base/event/init.py | Deduplicates existing unresolved-ForwardRef handling into a shared helper. |
| tests/units/test_attribute_access_type.py | Adds coverage for unannotated probes, unresolved annotations, and Python 3.14 lazy annotations. |
Reviews (3): Last reviewed commit: "Merge branch 'main' into annotation-prob..." | Re-trigger Greptile
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Uh oh!
There was an error while loading. Please reload this page.