Skip to content

fix(connector): an unknown dependency version must not read as older - #902

Open
whilo wants to merge 1 commit into
mainfrom
fix/version-check-unknown-local-versions
Open

fix(connector): an unknown dependency version must not read as older#902
whilo wants to merge 1 commit into
mainfrom
fix/version-check-unknown-local-versions

Conversation

@whilo

@whilo whilo commented Jul 26, 2026

Copy link
Copy Markdown
Member

The bug

get-version resolves a dependency's version from its Maven pom.properties. A :local/root source checkout has no such resource, so any dependency resolved from a sibling checkout reports nil.

version-check 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:

Database was written with newer konserve version.
{:stored "0.9.363", :now nil, ...}

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:

dependency previous guard
datahike DEVELOPMENT-aware both sides
hitchhiker-tree nil-safe (when (and hh-stored hh-now ...))
persistent-sorted-set neither
konserve neither

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:

(#'datahike.connector/check-version! "konserve" :t nil "0.9.363" {})   ;=> nil (skipped)
(#'datahike.connector/check-version! "konserve" :t "9.9.9" "0.1.0" {}) ;=> raises

Branched off main, single commit, independent of any in-flight work.

`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.
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.

1 participant