Repository navigation
Upgrade dependencies and adapt the borders loader to flatgeobuf 4 - #9
Merged
Merged
Conversation
flatgeobuf 4 makes geojson.deserialize an async generator of features, so BoundaryService.load failed on startup with "features is not iterable". Iterate it with for await inside the existing parse-error try. The cast moves to the single feature: its type leans on @types/geojson, which we do not install. Also upgrades fastify, @fastify/compress, flatbush, pg, typescript 7, vitest 5 and @types/node 26; none of those needed code changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Upgrades the dependencies and fixes the 1 upgrade that broke the service: flatgeobuf 3 → 4.
In flatgeobuf 4,
geojson.deserialize()always returns an async generator of features.BoundaryService.loadstill expected a FeatureCollection, so the service could not load its borders file and failed on startup. In the test suite that took down every API suite, since they all load the fixture inbeforeAll.The loader now iterates the generator with
for await. That loop sits inside the existingtry, because the reader is lazy and a corrupt file only fails while iterating. The cast moved from the whole return value to the single feature. flatgeobuf types its features against@types/geojson, which we don't install, so some cast stays. But the oldas unknown as GeoJsonFeatureCollectionis what hid this break from the type checker, and the iteration shape is now typed by the library.The other upgrades needed no code changes: fastify 5.12, @fastify/compress, flatbush, pg, TypeScript 7, vitest 5 and @types/node 26. I checked that by running the suite with everything upgraded except flatgeobuf: same result as on the old lockfile.
The rollback test in
boundary-service.test.tsmocks the deserializer, so its mock now yields features the way v4 does. Version bumped to 2.11.2 in its own commit.Tests: 756 passed, typecheck and typecheck:test clean.
pool.test.tscouldn't run locally because the sandbox blocks binding a port. It fails the same way on the old lockfile.🤖 Generated with Claude Code