fix(uninstall): Only clear credentials if the Cody app was uninstalled#2485
fix(uninstall): Only clear credentials if the Cody app was uninstalled#2485jamesmcnamara wants to merge 5 commits intomainfrom
Conversation
dominiccooney
left a comment
There was a problem hiding this comment.
Because the previous iteration of this caused a regression, let's add a test for this.
|
@dominiccooney Is this something that would be easy to test with the existing integration tests? |
@jamesmcnamara I would think about it this way:
|
| import com.sourcegraph.config.ConfigUtil | ||
| import java.util.concurrent.TimeUnit | ||
|
|
||
| class UninstallListener : StartupActivity { |
For unit test we can use |
|
@dominiccooney @pkukielka I've followed your advice and added a unit test using |
|
@dominiccooney @pkukielka Friendly Monday morning bump. I've added a test for the uninstaller. |

Take two of CODY-1043 that was reverted in #2484.
The issue is that uninstall events are triggered when any plugin is uninstalled and not just when the plugin that registered the handler is uninstalled. This checks that the plugin being uninstalled is in fact Cody before running the handler.
Test plan
I have manually tested that when uninstalling other extensions one branch of the
ifruns, and when uninstalling Cody the other half does.As discussed in #2434 it would be non-trivial to test this behavior because we will need to drive the installation and uninstallation of the plugin from an automated test driver, which will likely require a much more custom test kit.