Skip to content

Fix incomplete removal of databases#3455

Merged
koesie10 merged 2 commits intomainfrom
koesie10/extension-managed-location
Mar 11, 2024
Merged

Fix incomplete removal of databases#3455
koesie10 merged 2 commits intomainfrom
koesie10/extension-managed-location

Conversation

@koesie10
Copy link
Copy Markdown
Member

@koesie10 koesie10 commented Mar 8, 2024

When downloading a database from GitHub, the folder structure looks like this within the ${context.storageUri}/cpp directory:

Screenshot 2024-03-08 at 13 46 44

When removing this database, we were only deleting the shown cpp directory, and not the top-level cpp directory because we were deleting the directory that contained the database, rather than the directory that was created during the download.

This fixes it by storing the directory that we create during download on the database item so we can remove that directory when removing the database.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@koesie10 koesie10 force-pushed the koesie10/extension-managed-location branch from 3e6bddc to f426178 Compare March 8, 2024 12:48
@koesie10 koesie10 marked this pull request as ready for review March 8, 2024 13:54
@koesie10 koesie10 requested review from a team as code owners March 8, 2024 13:54
Copy link
Copy Markdown
Contributor

@robertbrignull robertbrignull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change look ok and I assume you've tested it locally that it fixes the bug and works ok. So I'm happy to approve on those grounds.

I'm surprised there are no test changes. Are there no tests of deleting databases?

extensionManagedLocation?: string;
}

export interface FullDatabaseOptions extends DatabaseOptions {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry it's not anything to do with this PR, but I don't think I've seen this code before and I don't love that it's a new piece of persisted data mixed with internal types...

@koesie10
Copy link
Copy Markdown
Member Author

I'm surprised there are no test changes. Are there no tests of deleting databases?

Thanks for noticing that. There do seem to be some tests for deleting databases, so I'll add a new one that tests the extension managed location.

@koesie10 koesie10 merged commit 1ab3dea into main Mar 11, 2024
@koesie10 koesie10 deleted the koesie10/extension-managed-location branch March 11, 2024 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants