From 07082f6bde688a02ff39681afd6589227786feeb Mon Sep 17 00:00:00 2001 From: Abhijeet <41686026+abhvsn@users.noreply.github.com> Date: Fri, 28 Jan 2022 13:37:59 +0530 Subject: [PATCH] fix: Copy evaluation version for cloned application from the source application to fix dynamic binding evaluation to support escaped characters without double escapes (#10702) --- .../server/services/ce/ApplicationPageServiceCEImpl.java | 1 + .../com/appsmith/server/services/ApplicationServiceTest.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java index 1fca972de8..92d71c1648 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/services/ce/ApplicationPageServiceCEImpl.java @@ -687,6 +687,7 @@ public class ApplicationPageServiceCEImpl implements ApplicationPageServiceCE { Application newApplication = new Application(sourceApplication); newApplication.setName(newName); newApplication.setLastEditedAt(Instant.now()); + newApplication.setEvaluationVersion(sourceApplication.getEvaluationVersion()); Mono userMono = sessionUserService.getCurrentUser().cache(); // First set the correct policies for the new cloned application return setApplicationPolicies(userMono, sourceApplication.getOrganizationId(), newApplication) diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationServiceTest.java index a0d021d789..70e02d2b0a 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ApplicationServiceTest.java @@ -990,6 +990,9 @@ public class ApplicationServiceTest { assertThat(clonedApplication.getOrganizationId().equals(orgId)); assertThat(clonedApplication.getModifiedBy()).isEqualTo("api_user"); assertThat(clonedApplication.getUpdatedAt()).isNotNull(); + assertThat(clonedApplication.getEvaluationVersion()).isNotNull(); + assertThat(clonedApplication.getEvaluationVersion()).isEqualTo(gitConnectedApp.getEvaluationVersion()); + List pages = clonedApplication.getPages(); Set clonedPageIdsFromApplication = pages.stream().map(page -> page.getId()).collect(Collectors.toSet()); Set clonedPageIdsFromDb = clonedPageList.stream().map(page -> page.getId()).collect(Collectors.toSet());