Skip to content

Conversation

@majiayu000
Copy link

Fixes #795

Changes

  • Apply WHERE clause check for cross detection in geofence hooks
  • When both old and new positions are outside the fence spatially, testObject() was never called, so WHERE clause filtering was skipped for cross events

The WHERE clause was being ignored for cross detection events in
geofence/SETHOOK commands. This happened because testObject() (which
checks WHERE clauses) was only called when an object was spatially
inside the fence. For cross events, both old and new object positions
are outside the fence, so testObject() was never invoked.

This fix adds an explicit WHERE clause check (via fieldMatch) in the
cross detection path before proceeding with event emission. This
ensures that cross events are only triggered for objects that match
the WHERE clause conditions.

Fixes tidwall#795

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
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.

Where clause is being ignored

1 participant