From b3aaaea181c4ea2da680c20a54f7fcda7b81294e Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Fri, 27 Dec 2024 15:48:58 +0530 Subject: [PATCH 1/4] fix: update client version in JsonSchemaVersionsFallback (#38390) Updated the client version from 1 to 2 in the JsonSchemaVersionsFallback class to align with the latest schema changes. With introduction fo HTML column type in appsmith table, we don't want, apps exported from a newer version to be importable in the older version. --- .../appsmith/server/migrations/JsonSchemaVersionsFallback.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java index c85b95bed5de..14a273555034 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/migrations/JsonSchemaVersionsFallback.java @@ -5,7 +5,7 @@ @Component public class JsonSchemaVersionsFallback { private static final Integer serverVersion = 11; - public static final Integer clientVersion = 1; + public static final Integer clientVersion = 2; public Integer getServerVersion() { return serverVersion; From d24930d9e4e5e5671af36046a966d561ed5dca0f Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Mon, 30 Dec 2024 13:36:52 +0530 Subject: [PATCH 2/4] fix: update clientSchemaVersion to prevent backward compatibility issues Updated the clientSchemaVersion in application.json from 1.0 to 2.0 to ensure that applications exported from newer versions cannot be imported into older versions, addressing potential compatibility issues with the introduction of HTML column types. --- .../resources/com/appsmith/server/migrations/application.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/server/appsmith-server/src/test/resources/com/appsmith/server/migrations/application.json b/app/server/appsmith-server/src/test/resources/com/appsmith/server/migrations/application.json index def16682e2bc..c7e9785ecd98 100644 --- a/app/server/appsmith-server/src/test/resources/com/appsmith/server/migrations/application.json +++ b/app/server/appsmith-server/src/test/resources/com/appsmith/server/migrations/application.json @@ -1,6 +1,6 @@ { "artifactJsonType": "APPLICATION", - "clientSchemaVersion": 1.0, + "clientSchemaVersion": 2.0, "serverSchemaVersion": 7.0, "exportedApplication": { "name": "json-schema-migration", From 019a8da68428a7aadc86216f3c940ab94bfae1f3 Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Thu, 2 Jan 2025 15:45:25 +0530 Subject: [PATCH 3/4] Updates clientSchemaVersion to latest --- .../com/appsmith/server/imports/internal/ImportServiceTests.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java index 38337a84be5a..3934ead1b527 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java @@ -272,6 +272,7 @@ public void setup() { testApplication.setLastDeployedAt(Instant.now()); testApplication.setModifiedBy("some-user"); testApplication.setGitApplicationMetadata(new GitArtifactMetadata()); + testApplication.setClientSchemaVersion(jsonSchemaVersions.getClientVersion()); Application.ThemeSetting themeSettings = getThemeSetting(); testApplication.setUnpublishedApplicationDetail(new ApplicationDetail()); From 51523c9179b6ca63602b72dd1e230dfa693e2a95 Mon Sep 17 00:00:00 2001 From: Rahul Barwal Date: Thu, 2 Jan 2025 16:29:57 +0530 Subject: [PATCH 4/4] update versions in json file --- .../appsmith/server/imports/internal/ImportServiceTests.java | 2 +- .../test_assets/ImportExportServiceTest/file-with-v1.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java index 3934ead1b527..90b21f24ada6 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/imports/internal/ImportServiceTests.java @@ -2732,7 +2732,7 @@ public void applySchemaMigration_jsonFileWithFirstVersion_migratedToLatestVersio ApplicationJson latestApplicationJson = tuple.getT2(); assertThat(v1ApplicationJson.getServerSchemaVersion()).isEqualTo(1); - assertThat(v1ApplicationJson.getClientSchemaVersion()).isEqualTo(1); + assertThat(v1ApplicationJson.getClientSchemaVersion()).isEqualTo(2); assertThat(latestApplicationJson.getServerSchemaVersion()) .isEqualTo(jsonSchemaVersions.getServerVersion()); diff --git a/app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/file-with-v1.json b/app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/file-with-v1.json index c9b595ecacee..21b237c8143d 100644 --- a/app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/file-with-v1.json +++ b/app/server/appsmith-server/src/test/resources/test_assets/ImportExportServiceTest/file-with-v1.json @@ -1,4 +1,4 @@ { "serverSchemaVersion": 1, - "clientSchemaVersion": 1 + "clientSchemaVersion": 2 }