fix: avoid duplicating inner tag in MemoComponent wrapper tag - #7004
fix: avoid duplicating inner tag in MemoComponent wrapper tag#7004LeonxLJX wants to merge 3 commits into
Conversation
Override _compute_memo_tag on MemoComponent to skip the self.tag segment, which is already embedded in the dynamic subclass __qualname__ (MemoComponent_<tag>). Previously the wrapper tag contained the inner tag twice (e.g. Memocomponent_card_98ffd1e1_card_98ffd1e1_<hash>). Adds a regression test asserting the inner tag appears exactly once. Closes reflex-dev#6955
Greptile SummaryThis PR removes the duplicated inner tag from generated memo-wrapper names and adds regression coverage. It also adds root and reflex-base release notes, although the package fragment is currently associated with the wrong pull-request number.
Confidence Score: 4/5The code change appears sound, but the reflex-base news fragment must be renamed so the generated release note references the correct pull request before merging. The package fragment is named 6955.bugfix.md even though this is PR 7004, causing the release record to associate the fix with the wrong pull request. Files Needing Attention: packages/reflex-base/news/6955.bugfix.md
|
| Filename | Overview |
|---|---|
| packages/reflex-base/src/reflex_base/components/memo.py | Overrides memo tag generation to remove the redundant self.tag segment while preserving the component hash and class-qualified prefix. |
| tests/units/compiler/test_memoize_plugin.py | Adds focused regression coverage asserting that generated memo-wrapper tags contain the wrapped tag exactly once. |
| packages/reflex-base/news/6955.bugfix.md | Adds the previously missing package release note, but its filename associates this PR's change with PR 6955 instead of PR 7004. |
| news/7004.bugfix.md | Adds the root-package release note using the current pull-request number. |
Reviews (3): Last reviewed commit: "chore: add reflex-base news fragment for..." | Re-trigger Greptile
Adds the required package news fragment so changelog validation passes for the user-facing memo-wrapper tag fix.
|
Added the missing Root cause. Fix. Override If you'd prefer the fragment wording tuned (e.g. mention the failing case explicitly), happy to adjust. |
| @@ -0,0 +1 @@ | |||
| Auto-memoized `@rx.memo` wrapper tags no longer duplicate the wrapped component's tag. `MemoComponent._compute_memo_tag` now skips the `self.tag` segment, which is already embedded in the dynamic subclass `__qualname__` (`MemoComponent_<tag>`), so generated wrapper names read as `Memocomponent_<tag>_<hash>` instead of `Memocomponent_<tag>_<tag>_<hash>`. | |||
There was a problem hiding this comment.
When the reflex-base changelog is materialized, the 6955.bugfix.md filename associates this change with PR 6955 instead of the current PR 7004, causing the generated release note to link to the wrong pull request.
Context Used: CLAUDE.md (source)
Knowledge Base Used: Release engineering
Override compute_memo_tag on MemoComponent to skip the self.tag segment, which is already embedded in the dynamic subclass qualname (MemoComponent). Previously the wrapper tag contained the inner tag twice (e.g. Memocomponent_card_98ffd1e1_card_98ffd1e1_).
Adds a regression test asserting the inner tag appears exactly once.
Closes #6955
All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
After these steps, you're ready to open a pull request.