Add checksum in index, and improve cache logic#27
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces optional SHA-256 checksums into DEM database indexing to verify cell integrity before loading, and adds an on-disk cache strategy for index.json in HTTP-backed databases to reduce repeated downloads.
Changes:
- Add SHA-256 support in index entries and validate downloads against expected hashes during cell load.
- Add
index.jsondisk caching forDemHttpStoragewith a configurable freshness duration. - Update DemUtility to support index building/updating and checksum verification workflows, plus add/expand tests around hashing and caching.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| MapToolkit/Databases/WellKnownDatabases.cs | Adjusts default User-Agent string used for HTTP database access. |
| MapToolkit/Databases/Sha256Helper.cs | Adds streaming SHA-256 compute/verify helper used by storages. |
| MapToolkit/Databases/IDemStorage.cs | Extends storage interface with async load + SHA retrieval hooks. |
| MapToolkit/Databases/DemHttpStorage.cs | Adds index caching + checksum-aware download/load behavior. |
| MapToolkit/Databases/DemFileSystemStorage.cs | Adds async index build with SHA-256 + checksum verification on load. |
| MapToolkit/Databases/DemDatabaseFileInfos.cs | Persists optional SHA-256 per cell entry in the index. |
| MapToolkit/Databases/DemDatabaseEntry.cs | Plumbs expected SHA-256 into storage load calls. |
| MapToolkit/Databases/DemDatabase.cs | Propagates SHA-256 from index into runtime entries. |
| MapToolkit/DataCells/DemDataCellMetadata.cs | Adds legacy JSON property names for backward compatibility. |
| MapToolkit.Test/Databases/WellKnownDatabasesTest.cs | Clears default HTTP cache to stabilize tests. |
| MapToolkit.Test/Databases/Sha256HelperTest.cs | Adds unit tests for SHA-256 helper. |
| MapToolkit.Test/Databases/DemHttpStorageTest.cs | Adds tests for HTTP caching and checksum behavior. |
| MapToolkit.Test/Databases/DemFileSystemStorageTest.cs | Adds tests for filesystem SHA-256 retrieval. |
| MapToolkit.Test/Databases/DemDatabaseTest.cs | Updates mocks to use LoadAsync. |
| MapToolkit.Test/Databases/DemDatabaseEntryTest.cs | Updates mocks to use LoadAsync. |
| DemUtility/Properties/launchSettings.json | Adds/updates local and CDN “index/update/check” launch profiles. |
| DemUtility/ProgressReport.cs | Removes custom progress reporter (replaced by progress tracking). |
| DemUtility/Program.cs | Reworks CLI; adds update-index/check commands; integrates progress tracking. |
| DemUtility/DemUtility.csproj | Switches CLI dependencies and changes target framework. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds: