fix(drag-drop): gracefully handle missing record in initial group during drop#19030
Open
JasonOA888 wants to merge 1 commit intotwentyhq:mainfrom
Open
fix(drag-drop): gracefully handle missing record in initial group during drop#19030JasonOA888 wants to merge 1 commit intotwentyhq:mainfrom
JasonOA888 wants to merge 1 commit intotwentyhq:mainfrom
Conversation
…ing drop - Replace throw with console.warn and early return when record is not found - This prevents app crash during race conditions in concurrent drag operations - Issue twentyhq#16585
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Contributor
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #16585
Replace
throw new Error()withconsole.warn()and early return when a record is not found in the initial record group during a drop operation.Problem
The error
Cannot find record id in initial record group ids on dropwas being thrown when:This caused the app to crash instead of gracefully handling the edge case.
Solution
throw new Error()withconsole.warn()and earlyreturnTesting
Changes
packages/twenty-front/src/modules/object-record/record-drag/hooks/useUpdateDroppedRecordOnBoard.ts