fix(connector): an unknown dependency version must not read as older - #902
Open
whilo wants to merge 1 commit into
Open
fix(connector): an unknown dependency version must not read as older#902whilo wants to merge 1 commit into
whilo wants to merge 1 commit into
Conversation
`get-version` resolves a dependency's version from its Maven `pom.properties`. A `:local/root` source checkout has no such resource, so every dependency resolved from a sibling checkout reports `nil`. `version-check` then compared that `nil` against the version recorded in the store. `(compare nil "0.9.363")` is -1, so an unknown version read as OLDER and the connect was refused with "Database was written with newer konserve version" — making every store written by a released konserve unopenable from a source checkout of the stack, which is exactly the cross-repo development setup this project is built for. The four per-dependency guards had drifted into three different shapes: DEVELOPMENT-aware for datahike, nil-safe for hitchhiker-tree, and neither for persistent-sorted-set or konserve. Collapse them onto one `check-version!` with one rule — compare only when both sides are known — so a dependency added later cannot land on the strict variant by accident. Released dependencies compare exactly as before; only the unknown/DEVELOPMENT cases change, and those previously could not connect at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
get-versionresolves a dependency's version from its Mavenpom.properties. A:local/rootsource checkout has no such resource, so any dependency resolved from a sibling checkout reportsnil.version-checkcompared thatnilagainst the version recorded in the store.(compare nil "0.9.363")is-1, so an unknown version read as older and the connect was refused:Net effect: a store written by a released konserve cannot be opened from a source checkout of the stack — precisely the cross-repo development setup this project is built for. Hit while developing simmis against local checkouts of datahike/konserve/yggdrasil; no existing store would open.
The fix
The four per-dependency guards had drifted into three different shapes:
when (and hh-stored hh-now ...))Collapsed onto one
check-version!with one rule — compare only when both sides are known — so a dependency added later can't land on the strict variant by accident.Compatibility
Released dependencies compare exactly as before. Only the
nil/"DEVELOPMENT"cases change, and those previously could not connect at all.Verified:
Branched off
main, single commit, independent of any in-flight work.