-
Notifications
You must be signed in to change notification settings - Fork 4.6k
fix: generate unique widgetIds when cloning page #41762
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
Open
amelia-c0n
wants to merge
6
commits into
release
Choose a base branch
from
fix/clone-widgetid-duplicates
base: release
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d8b174b
fix: generate unique widgetIds when cloning page
1fea8cd
Merge branch 'release' into fix/clone-widgetid-duplicates
amelia-c0n 015c955
fixing errors
96e048e
fixing test in PageServiceTest
6b153aa
Merge branch 'release' into fix/clone-widgetid-duplicates
amelia-c0n 30118ce
Merge branch 'release' into fix/clone-widgetid-duplicates
amelia-c0n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 50376
🏁 Script executed:
cat -n app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/DslUtils.java | head -120Repository: appsmithorg/appsmith
Length of output: 6048
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 434
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 46
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 5052
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 151
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 151
🏁 Script executed:
cat app/server/appsmith-server/src/test/java/com/appsmith/server/helpers/DslUtilsTest.java | head -250Repository: appsmithorg/appsmith
Length of output: 11395
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 3662
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 3570
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 1000
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 46
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 2164
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 893
🏁 Script executed:
Repository: appsmithorg/appsmith
Length of output: 6416
collectWidgetIdsmisses nested widget trees under non-childrenkeys — List widgettemplatefield contains widgets with IDs that won't be collected.The traversal asymmetry causes data integrity issues:
collectWidgetIdsonly recurses throughFieldName.CHILDRENand skips thetemplatefield (defined as"template"inFieldName.LIST_WIDGET_TEMPLATE). This means widgets nested underList1.template.{WidgetName}won't have their IDs collected or regenerated during page cloning. However,rewriteWidgetIdReferencestraverses all nested structures (Maps and Lists), so it will still attempt to rewrite any references to those uncollected template widget IDs elsewhere in the DSL. The result is an inconsistent state where template widgets retain source IDs while references to them are updated, causing potential collisions or dangling pointers.The test suite lacks coverage for this scenario — all
DslUtilsTestcases use only thechildrenstructure.🤖 Prompt for AI Agents