-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Fix: update data overwrites the insert data in grid #10156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThe pull request focuses on modifications to the Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/nc-gui/composables/useInfiniteData.ts (1)
986-989: InitializecachedRowto prevent potential undefined usage.
Declaringlet cachedRow: Rowthen assigning in a later block might cause confusion or potential runtime errors if flow changes in the future. Although the code flow ensures it's assigned before usage, explicitly initializing could improve clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/nc-gui/composables/useInfiniteData.ts(3 hunks)
🔇 Additional comments (2)
packages/nc-gui/composables/useInfiniteData.ts (2)
841-847: Confirm merged data order when inserting rows.
Here, row: { ...insertedData, ...currentRow.row } places any existing properties in currentRow.row last, meaning they override server-returned insertedData if there's a conflict. This is likely correct for preserving unsaved changes, but if you want server-derived properties like "CreatedAt"/"CreatedBy" to take precedence, consider reversing the spread order or removing the second spread altogether if it’s unintended.
999-1009: Ensure old metadata is retained during property updates.
Merging (cachedRow || row) with additional updates preserves any prior metadata like "CreatedBy" or "CreatedAt." This behavior matches the PR's goal of preventing overwrites that discard metadata during updates. The code looks good, but be sure to confirm all calling code uses the updated approach consistently.
|
Uffizzi Preview |
Change Summary
Created At and CreatedBy info getting lost in grid when the record is updated while getting saved
Closes #9490
Change type