Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different geofences listening to the same collection (but with a WHERE filter) emit an event at the same time #721

Open
iansalazar444 opened this issue Feb 29, 2024 · 0 comments

Comments

@iansalazar444
Copy link

Describe the bug
Hi, everyone!

I noticed that when two Geofences were created via the SETHOOK command, where they listen to the same collection (but have a filter using WHERE), the WHERE command is ignored and instead they both emit an event at the same time.

To Reproduce

  1. Create two points
SET teams/team1/assets point1 FIELD metadata {"teamRegionId":"f6b7d34a-8610-4bcc-bc87-eb1ae9cbe723"} POINT 42.929 -72.284
SET teams/team1/assets point2 FIELD metadata {"teamRegionId":"90b30c32-e730-4aa0-b92c-73746e390421"} POINT 42.929 -72.284
  1. Create two geofences, both of them listening to the collection teams/team1/assets
teams/team1/geofences/geofence1/hook https://some-endpoint.com INTERSECTS teams/team1/assets WHERE 'metadata.teamRegionId == "f6b7d34a-8610-4bcc-bc87-eb1ae9cbe723"' OBJECT {"type":"Polygon","coordinates":[[[-72.2824967,42.9281719],[-72.2823465,42.9261137],[-72.2789025,42.9261529],[-72.2787738,42.9282112],[-72.2824967,42.9281719]]],"properties":{}}

teams/team1/geofences/geofence2/hook https://some-endpoint.com INTERSECTS teams/team1/assets WHERE 'metadata.teamRegionId == "90b30c32-e730-4aa0-b92c-73746e390421"' OBJECT {"type":"Polygon","coordinates":[[[-72.2824967,42.9281719],[-72.2823465,42.9261137],[-72.2789025,42.9261529],[-72.2787738,42.9282112],[-72.2824967,42.9281719]]],"properties":{}}
  1. Move the first point, point1 inside the geofence teams/team1/geofences/geofence1/hook and teams/team1/geofences/geofence2/hook (you may ignore the other fields like metadata in this context)
SET teams/6a368f6d-8857-4e45-8e2b-7fdbcfb93ee0/assets point1 FIELD metadata {"teamRegionId":"f6b7d34a-8610-4bcc-bc87-eb1ae9cbe723"} POINT 42.927 -72.28

Expected behavior
As the first geofence geofence1 was created with a WHERE filter metadata.teamRegionId == "f6b7d34a-8610-4bcc-bc87-eb1ae9cbe723", geofence1 should be the only geofence to send an event to the webhook endpoint https://some-endpoint.com, but for some reason, the second geofence geofence2 also sends an event, even though it had a filter WHERE 'metadata.teamRegionId == "90b30c32-e730-4aa0-b92c-73746e390421"'

The same would happen if you move point2 inside geofence2. If that happens, geofence1 will also send an event even if point2 doesn't match geofence1's WHERE filter

Logs
N/A

Operating System (please complete the following information):

  • OS: Ubuntu 22.04.3 LTS
  • CPU: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  • Version: latest
  • Container: Docker
@iansalazar444 iansalazar444 changed the title Geofences listening to the same collection (with WHERE filter) emits at the same time Different geofences listening to the same collection (but with a WHERE filter) emits an event at the same time Feb 29, 2024
@iansalazar444 iansalazar444 changed the title Different geofences listening to the same collection (but with a WHERE filter) emits an event at the same time Different geofences listening to the same collection (but with a WHERE filter) emit an event at the same time Feb 29, 2024
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

No branches or pull requests

1 participant