Skip to content

Commit

Permalink
fix: App deleted when the user creates branch in few scenarios (#18964)
Browse files Browse the repository at this point in the history
## Description

> Continuing from the PR - #18034. The app getting deleted bug was introduced when creating branch was introduced in the linked PR. 
Current PR adds a check to ensure that none of the git flow is affected. 

Fixes - https://app.frontapp.com/inboxes/teams/folders/15585868/unassigned/66043703436

## Type of change

- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?

- Manual

## Checklist:
### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


### QA activity:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or manual QA
- [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
  • Loading branch information
AnaghHegde committed Dec 15, 2022
1 parent 8ed9d20 commit 051444f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -1170,7 +1170,7 @@ private Mono<Application> importApplicationInWorkspace(String workspaceId,
})
.onErrorResume(throwable -> {
log.error("Error while importing the application ", throwable.getMessage());
if (importedApplication.getId() != null) {
if (importedApplication.getId() != null && applicationId == null) {
return applicationPageService.deleteApplication(importedApplication.getId())
.then(Mono.error(new AppsmithException(AppsmithError.GENERIC_JSON_IMPORT_ERROR, workspaceId, throwable.getMessage())));
}
Expand Down
Expand Up @@ -1169,7 +1169,7 @@ private Mono<Application> importApplicationInWorkspace(String workspaceId,
})
.onErrorResume(throwable -> {
log.error("Error while importing the application ", throwable.getMessage());
if (importedApplication.getId() != null) {
if (importedApplication.getId() != null && applicationId == null) {
return applicationPageService.deleteApplication(importedApplication.getId())
.then(Mono.error(new AppsmithException(AppsmithError.GENERIC_JSON_IMPORT_ERROR, workspaceId, throwable.getMessage())));
}
Expand Down

0 comments on commit 051444f

Please sign in to comment.