fix: Add migration to fix deleted themes when branch was deleted#14957
fix: Add migration to fix deleted themes when branch was deleted#14957
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Unable to find test scripts. Please add necessary tests to the PR. |
94ecbce to
a6a0871
Compare
|
Unable to find test scripts. Please add necessary tests to the PR. |
1 similar comment
|
Unable to find test scripts. Please add necessary tests to the PR. |
| Criteria deletedCustomThemes = Criteria.where(fieldName(QTheme.theme.id)).in(set) | ||
| .and(fieldName(QTheme.theme.deleted)).is(true); | ||
|
|
||
| mongockTemplate.updateMulti(new Query(deletedCustomThemes), update, Theme.class); |
There was a problem hiding this comment.
@nayan-rafiq the issue is happening when users have a custom theme with multiple branches and if any of the branches is deleted all the branches will end up in a broken state. This is happening because the same themeIds are referenced in all the branched applications, where we expect separate objects in Theme collection with separate themeIds for different branches. With the current migration, I'm not getting where are we inserting new documents in the Theme collection and updating the corresponding ids in the branched application object in DB. IIUC this migration will only revert the deleted custom themes
There was a problem hiding this comment.
When user has customized the theme and created a new branch, the newly created branch have the same theme ids as parent branch (it should've been copied). Now, if user deletes the new branch, it deletes the themes as well. So, if we set deleted=false to those themes, would it not be enough? It'll be a problem if we've option to restore a deleted branch. Is that happening today?
There was a problem hiding this comment.
@nayan-rafiq consider user has already created 3 branches before we fixed the issue for the custom theme app. As per our expectation we should have 3 seperate theme ids attached to these apps which will not be the case. Now consider after we run the migration there won't be any change considering all the branches are still active.
In this scenario (after we run the migration) what will happen if user tries to delete the earlier branch (out of 3 branches created earlier)? As we are not checking if the theme id is being used in some other branch, it will get deleted and we will end up in same situation again.
|
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
|
This PR has been closed because of inactivity. |
|
/ok-to-test sha=1a29e4e |
|
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2713807557. |
|
/ok-to-test sha=7b12b2a |
|
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/2738704052. |
|
UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/2738704052. Click to view performance test results
|
Description
Due to a bug, customized themes set to the parent branch where deleted when user deletes git branch. The bug has been fixed already. This PR adds a DB migration that fixes the data if there is any.
Fixes #15247
Type of change
How Has This Been Tested?
Checklist: