Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug where dbs are lost on restart #1638

Merged
merged 4 commits into from
Oct 25, 2022
Merged

Conversation

aeisenberg
Copy link
Contributor

@aeisenberg aeisenberg commented Oct 20, 2022

If the workspace is restarted while databases are being loaded, this change prevents any from being lost.

The bug was that each time a database was added when rehydrating a db from persisted state on startup, the persisted db list was being updated. Instead of updating the list each time we add a db, on restart, instead update the persisted list only after all are added.

Note that we need to update the persisted list after reading it in since the act of rehydrating a database may change its persisted state. For example, the primary language of the database may be initialized if it was not able to be determined originally.

Fixes #1489

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.

If the workspace is restarted while databases are being loaded, this
change prevents any from being lost.

The bug was that each time a database was added when rehydrating a db
from persisted state on startup, the persisted db list
was being updated. Instead of updating the list each time we add a db,
on restart, instead update the persisted list only after all are added.

Note that we need to update the persisted list after reading it in since
the act of rehydrating a database _may_ change its persisted state.
For example, the primary language of the database may be initialized
if it was not able to be determined originally.
@aeisenberg aeisenberg requested a review from a team as a code owner October 20, 2022 23:21
@aeisenberg aeisenberg changed the base branch from main to aeisenberg/fix-flakes October 21, 2022 00:06
@aeisenberg aeisenberg requested a review from a team as a code owner October 21, 2022 00:06
@aeisenberg aeisenberg changed the base branch from aeisenberg/fix-flakes to main October 21, 2022 00:08
@aeisenberg aeisenberg changed the base branch from main to aeisenberg/fix-flakes October 21, 2022 00:09
Base automatically changed from aeisenberg/fix-flakes to main October 25, 2022 15:26
@aeisenberg aeisenberg enabled auto-merge October 25, 2022 15:54
@aeisenberg aeisenberg merged commit 56af69e into main Oct 25, 2022
@aeisenberg aeisenberg deleted the aeisenberg/persist-dbs branch October 25, 2022 17:29
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.

Restarting vscode while the extension is starting up can remove databases.
2 participants