chore(geofence): enrich transition events with geofence metadata#775
chore(geofence): enrich transition events with geofence metadata#775mrehan27 wants to merge 1 commit into
Conversation
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d334411. Configure here.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/geofence-on-device #775 +/- ##
================================================================
- Coverage 67.76% 67.71% -0.06%
+ Complexity 1127 1126 -1
================================================================
Files 206 206
Lines 6400 6417 +17
Branches 888 896 +8
================================================================
+ Hits 4337 4345 +8
- Misses 1746 1751 +5
- Partials 317 321 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
|
Build available to test |
📏 SDK Binary Size Comparison Report
|
d334411 to
db30ef4
Compare
|
|
Carry `metadata` from POST /geofences/nearest onto the "Geofence Transition" event. Snapshot metadata+name into the pending delivery at crossing time, then prefer the still-cached region's current values at send (hybrid), falling back to the snapshot when the fence is gone. metadata is stored as Map<String, JsonElement> and unwrapped to Kotlin primitives at emit; non-scalars are dropped at parse and the payload is capped as a runaway-payload backstop. Also drops the now-optional `radius` from the nearby request. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
db30ef4 to
b901b85
Compare
|
|

Enriches the "Geofence Transition" event with workspace-defined
metadatafromPOST /geofences/nearest.What
metadata(scalar string/number/bool map) from the nearby response is cached on the region, snapshotted onto the pending delivery at crossing time, and preferred fresh from cache at send — falling back to the snapshot when the geofence has left the cache (same hybrid asgeofenceName).metadataobject on the event, always present (empty{}when the fence has none). Values keep their type (string/long/double/boolean).geosetIdnow emitted as a plain string (dropped the numeric coercion).radiusfrom the/geofences/nearestrequest body (now optional server-side).Notes
inputDataand loads the full row from the store, so metadata (which can be large) never risks the ~10 KBDatalimit and the worker always sends the authoritative snapshot rather than a copy.PendingDeliveryStore.get(key)in:core(not in the API dump).radiustoo).Stack
Test plan
./gradlew :core:testDebugUnitTest :core:apiCheck :geofence:testDebugUnitTest :geofence:apiCheck :messagingpush:testDebugUnitTest— greenmake lint-no-format— greenMBL-2045
Note
Medium Risk
Changes geofence event payload shape (metadata, geosetId typing) and delivery path (worker reads store by key); behavior is well-tested but affects background analytics and nearest-fetch semantics.
Overview
Geofence transition track events now carry workspace
metadatafromPOST /geofences/nearest: parsed and capped at ingest, cached on regions, snapshotted on pending deliveries, and merged at send time viawithFreshestEventData(cache wins for name/metadata, same pattern asgeofenceName).metadatais always on the event properties (empty map when none);geosetIdis emitted as a string.WorkManager no longer inlines transition fields in
inputData—only the pending-storeentry_key—so large metadata cannot hit the ~10 KBDatalimit; the worker uses newPendingDeliveryStore.get. Direct HTTP and foreground flush both build the same property set./geofences/nearestrequests drop clientradius;remoteSearchRadiusMetersis removed. Metadata/geoset-only region updates skip GMS re-register viaequalsForRegistration.Reviewed by Cursor Bugbot for commit b901b85. Bugbot is set up for automated code reviews on this repo. Configure here.