Skip to content

fix: realtime matching no longer throws after geospatial unsubscriptions - #2939

Merged
rolljee merged 2 commits into
2-devfrom
fix/koncorde-geo-remove
Sep 27, 2026
Merged

rolljee merged 2 commits into
2-devfrom
fix/koncorde-geo-remove

Conversation

@rolljee

@rolljee rolljee commented Sep 26, 2026

Copy link
Copy Markdown
Member

Bug (present in 2.56.0)

Once subscriptions with geospatial filters have been removed, matching a document can throw TypeError: subfilters is not iterable in koncorde. The notifier awaits that match on every write — document:create → core:realtime:document:notify → notifyDocuments → _test → koncorde.test(), no catch on the way — so the API request fails with an internal error after the document was written, and no notification is sent for it.

Reproduced with 2.56.0's koncorde 4.7.0: 2 000 geoDistance subscriptions, half removed, 5 000 documents → 62 throws on Node 22, 460 on Node 24.

Cause: boost-geospatial-index's R* tree sometimes failed to remove a shape (rtree.remove() returned 0), so its id kept coming back without a subfilter. Fixed there, with regression tests at both levels:

What

Verified

pr-preflight ✅ · vitest in Docker ✅ 3 909 passed (one more than 2-dev) · CI runs the functional matrix.

After this, 2-dev → beta publishes 2.57.0-beta.2.

🤖 Generated with Claude Code

rolljee and others added 2 commits September 27, 2026 00:49
koncorde 4.8.0-beta.1 → 4.8.0-beta.2, with boost-geospatial-index
1.5.0-beta.2 (kuzzleio/boost-geospatial-index#29, kuzzleio/koncorde#84).

The geospatial index sometimes failed to remove a shape, whose id then kept
matching without a subfilter behind it, and Koncorde#test threw "subfilters
is not iterable". The notifier awaits that match on every document write
(document:create → core:realtime:document:notify → notifyDocuments → _test),
so the write request answered with an internal error after the document had
been written, and no notification was sent. Reproduced on 2.56.0's
koncorde 4.7.0: 2 000 geoDistance subscriptions, half removed, 5 000
documents → 62 throws on Node 22, 460 on Node 24.

tests/util/koncordeCompat.test.ts runs that scenario through koncordeTest,
the notifier's entry point.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…a status

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@rolljee
rolljee merged commit f84c96f into 2-dev Sep 27, 2026
87 of 88 checks passed
@rolljee
rolljee deleted the fix/koncorde-geo-remove branch September 27, 2026 04:17
@kuzzlebot

kuzzlebot Bot commented Sep 27, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.57.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kuzzlebot

kuzzlebot Bot commented Sep 30, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.57.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@kuzzlebot kuzzlebot Bot added the released This issue/pull request has been released. label Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released on @beta released This issue/pull request has been released.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant