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
1 change: 1 addition & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [UNRELEASED]

- Fix a bug where databases may be lost if VS Code is restarted while the extension is being started up. [#1638](https://github.com/github/vscode-codeql/pull/1638)
- Add commands for navigating up, down, left, or right in the result viewer. Previously there were only commands for moving up and down the currently-selected path. We suggest binding keyboard shortcuts to these commands, for navigating the result viewer using the keyboard. [#1568](https://github.com/github/vscode-codeql/pull/1568)

## 1.7.2 - 14 October 2022
Expand Down
13 changes: 10 additions & 3 deletions extensions/ql-vscode/src/databases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ export class DatabaseManager extends DisposableObject {
this._onDidChangeDatabaseItem.fire(event);
});

await this.addDatabaseItem(progress, token, item);
// Avoid persisting the database state after adding since that should happen only after
// all databases have been added.
await this.addDatabaseItem(progress, token, item, false);
return item;
}

Expand Down Expand Up @@ -724,6 +726,7 @@ export class DatabaseManager extends DisposableObject {
void this.logger.log(`Error loading database ${database.uri}: ${e}.`);
}
}
await this.updatePersistedDatabaseList();
} catch (e) {
// database list had an unexpected type - nothing to be done?
void showAndLogErrorMessage(`Database list loading failed: ${getErrorMessage(e)}`);
Expand Down Expand Up @@ -784,10 +787,14 @@ export class DatabaseManager extends DisposableObject {
private async addDatabaseItem(
progress: ProgressCallback,
token: vscode.CancellationToken,
item: DatabaseItem
item: DatabaseItem,
updatePersistedState = true
) {
this._databaseItems.push(item);
await this.updatePersistedDatabaseList();

if (updatePersistedState) {
await this.updatePersistedDatabaseList();
}

// Add this database item to the allow-list
// Database items reconstituted from persisted state
Expand Down