Repository navigation
Conversation
|
@Rober1208 is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough新增内部 Store 备份与恢复机制。表单根据首次挂载时的 Changes表单 Store 恢复
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Form
participant FormStoreSnapshot
participant FormStore
Form->>FormStoreSnapshot: 传入 backupStore 和 clearOnDestroy
FormStoreSnapshot->>FormStore: 卸载时调用 backupStore()
FormStore-->>FormStoreSnapshot: 返回条件恢复回调
FormStoreSnapshot->>FormStore: 挂载时调用恢复回调
Merge Risk: ⚪ Minimal · up to The change preserves form values across StrictMode and Activity replays with explicit-write guards and broad regression tests. No actionable merge-blocking issue remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Recovery respects explicit value updates, and ordinary unmount cleanup remains intact. A narrow ownership risk remains if multiple overlapping forms share one instance: replay could restore values another form has cleared. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 小兔捧来一枚表单值, Comment |
With
clearOnDestroyenabled, StrictMode's mount replay clears the form store without initializing it again. Initial values and values set before fields mount disappear fromgetFieldsValue(true); a later rerender or delayed field mount displays an empty value. Related to ant-design/ant-design#54467.Capture the store before fields unregister and restore it before their mount callbacks during replay, using a component that renders no DOM. Explicit value updates or resets after cleanup take precedence over the saved snapshot; internal field initialization and metadata-only updates do not cancel recovery. Named fields refresh when the mount-time value differs from their last rendered value, keeping the displayed value consistent with the recovered store. A genuine unmount still clears the store through the existing cleanup, and a new mount starts with its initial values.
Validation:
setFieldsValue,setFieldValue, value-bearingsetFields,resetFields, hidden field initialization, metadata-only updates and the unchanged ordinary-mount render count.npm test -- --coverage: 24 test files passed, 229 tests passed, 1 existing skipped test.npm run lint,npm run tsc,npm run compileand formatting checks passed.Local installation used
npm install --legacy-peer-depsbecause the unchanged package manifest pairs ESLint 10 with eslint-plugin-react's ESLint 9 peer range. No dependency or lockfile changes are included. The local commands exercise the project's scripts; upstream CI has not run yet.React 16.9 runtime verification was blocked on both the base and the fix by the installed
@rc-component/utilimportingreact-dom/client. No React Native host integration test was run.Summary by CodeRabbit