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

Binary files are not hashed correctly in CacheService #1706

Open
misode opened this issue Jan 4, 2025 · 0 comments · May be fixed by #1707
Open

Binary files are not hashed correctly in CacheService #1706

misode opened this issue Jan 4, 2025 · 0 comments · May be fixed by #1707
Labels
🐛 bug Something isn't working /core ⚡ performance Improve performance

Comments

@misode
Copy link
Member

misode commented Jan 4, 2025

To validate whether a file's symbols are still valid, the CacheService computes the file's current hash with the checksum in the cache file.

The former (current hash) is computed with this.project.fs.hash(root) which uses externals.crypto.getSha1(await externals.fs.readFile(uri)) internally. But the latter is done via this.project.externals.crypto.getSha1(doc.getText()) when the documentUpdate event is emitted.

This means that the hashes are always different when saving the cache and later validating it, putting unnecessary files in the changedFiles list.

@misode misode added /core ⚡ performance Improve performance 🐛 bug Something isn't working labels Jan 4, 2025
@misode misode linked a pull request Jan 4, 2025 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working /core ⚡ performance Improve performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant