Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public enum AppsmithError {

REMOVE_LAST_ORG_ADMIN_ERROR(400, 4037, "The last admin can not be removed from an organization", AppsmithErrorAction.DEFAULT, null, ErrorType.INTERNAL_ERROR),
INVALID_CRUD_PAGE_REQUEST(400, 4038, "Unable to process page generation request, {0}", AppsmithErrorAction.DEFAULT, null, ErrorType.BAD_REQUEST),
INVALID_IMPORTED_FILE_ERROR(400, 4039, "Provided file is from different version, please wait till Appsmith gets auto-updated to latest version. This may take a day or two. We are really sorry for the inconvenience caused", AppsmithErrorAction.DEFAULT, null, ErrorType.INTERNAL_ERROR),
INVALID_IMPORTED_FILE_ERROR(400, 4039, "You seem to have imported an application from an older version of Appsmith. This is not supported. Please export your application again from your Appsmith server before importing it again.", AppsmithErrorAction.DEFAULT, null, ErrorType.BAD_REQUEST),
INTERNAL_SERVER_ERROR(500, 5000, "Internal server error while processing request", AppsmithErrorAction.LOG_EXTERNALLY, null, ErrorType.INTERNAL_ERROR),
REPOSITORY_SAVE_FAILED(500, 5001, "Failed to save the repository. Try again.", AppsmithErrorAction.DEFAULT, null, ErrorType.INTERNAL_ERROR),
PLUGIN_INSTALLATION_FAILED_DOWNLOAD_ERROR(500, 5002, "Plugin installation failed due to an error while " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,8 @@ public Mono<Application> importApplicationInOrganization(String organizationId,

if(!errorField.isEmpty()) {
return Mono.error(new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, errorField, INVALID_JSON_FILE));
} else if(importedDoc.getAppsmithVersion() == null) {
return Mono.error(
new AppsmithException(
AppsmithError.JSON_PROCESSING_ERROR,
": Unable to find version field in the uploaded file. Can you please try exporting the " +
"application from source Appsmith server and then importing it once again"
));
} else if(!releaseNotesService.getReleasedVersion().equals(importedDoc.getAppsmithVersion())) {
} else if(importedDoc.getAppsmithVersion() == null
|| !releaseNotesService.getReleasedVersion().equals(importedDoc.getAppsmithVersion())) {
return Mono.error(new AppsmithException(AppsmithError.INVALID_IMPORTED_FILE_ERROR));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public void importApplicationFromValidJsonFileTest() {
final List<Datasource> datasourceList = tuple.getT2();
final List<ActionDTO> actionDTOS = tuple.getT3();
final List<PageDTO> pageList = tuple.getT4();

assertThat(application.getName()).isEqualTo("valid_application");
assertThat(application.getOrganizationId()).isNotNull();
assertThat(application.getPages()).hasSize(2);
Expand Down Expand Up @@ -543,7 +543,7 @@ public void importApplicationWithoutVersionTest() {
StepVerifier
.create(resultMono)
.expectErrorMatches(throwable -> throwable instanceof AppsmithException &&
throwable.getMessage().contains(AppsmithError.JSON_PROCESSING_ERROR.getMessage(": Unable to find version field in the uploaded file.")))
throwable.getMessage().equals(AppsmithError.INVALID_IMPORTED_FILE_ERROR.getMessage()))
.verify();
}

Expand Down