maxyu1115 / maxyu1115/git-backup-sync
Refactor and fix BranchInfoManager caching behavior
@mmmyr is already working on this.
Since Mar 25, 2023.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
Currently the BranchInfoManager caches the branch info file in memory, to prevent repeated reads. This was intended to speed things up, since most of the time users don't change the branch info file, and with features like autobackup enabled, we frequently need the information from the bbinfo file.
However, this has led to many bugs, such as #20 . There are also bugs when the branch info file is edited outside of the vscode editor, such as the user using vim, or even switching git branches.
Therefore, we need to do a total refactor to the current BranchInfoManager.
My current thoughts are to:
- refactor BranchInfoManager to not check file path, but instead have method
invalidateCache(), which the extension will call in a variety of situations. - The extension will call
invalidateCache()when the config is reloaded. (Or only when the branchInfoPath is changed? ) - Then extension will use
vscode.workspace.createFileSystemWatcherto monitor the branch info file?
Maybe there are other ways to do this. Worst case scenario we will need to remove caching behavior...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.