Skip to content

Commit

Permalink
Merge pull request #959 from alexet/fix-db-remove
Browse files Browse the repository at this point in the history
Delete database after removing it from query server control.
  • Loading branch information
aeisenberg authored Oct 7, 2021
2 parents b92d6ba + 6292adf commit 197ab99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Add progress messages to LGTM download option. This makes the two-step process (selecting a project, then selecting a language) more clear. [#960](https://github.com/github/vscode-codeql/pull/960)
- Remove line about selecting a language from the dropdown when downloading database from LGTM. This makes the download progress visible when the popup is not expanded. [#957](https://github.com/github/vscode-codeql/pull/957)
- Fixed a bug where copying the version information fails when a CodeQL CLI cannot be found. [#958](https://github.com/github/vscode-codeql/pull/958)
- Avoid a race condition when deleting databases that can cause occasional errors. [#959](https://github.com/github/vscode-codeql/pull/959)

## 1.5.5 - 08 September 2021

Expand Down
6 changes: 3 additions & 3 deletions extensions/ql-vscode/src/databases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,9 @@ export class DatabaseManager extends DisposableObject {
vscode.workspace.updateWorkspaceFolders(folderIndex, 1);
}

// Remove this database item from the allow-list
await this.deregisterDatabase(progress, token, item);

// Delete folder from file system only if it is controlled by the extension
if (this.isExtensionControlledLocation(item.databaseUri)) {
void logger.log('Deleting database from filesystem.');
Expand All @@ -819,9 +822,6 @@ export class DatabaseManager extends DisposableObject {
e => void logger.log(`Failed to delete '${item.databaseUri.fsPath}'. Reason: ${e.message}`));
}

// Remove this database item from the allow-list
await this.deregisterDatabase(progress, token, item);

// note that we use undefined as the item in order to reset the entire tree
this._onDidChangeDatabaseItem.fire({
item: undefined,
Expand Down

0 comments on commit 197ab99

Please sign in to comment.