Skip to content

chore(geofence): remove unused FETCH_ALL sync mode#774

Merged
mrehan27 merged 1 commit into
feature/geofence-on-devicefrom
mbl-2008-remove-geofence-fetch-all
Jul 10, 2026
Merged

chore(geofence): remove unused FETCH_ALL sync mode#774
mrehan27 merged 1 commit into
feature/geofence-on-devicefrom
mbl-2008-remove-geofence-fetch-all

Conversation

@mrehan27

@mrehan27 mrehan27 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Remove the GeofenceSyncMode abstraction entirely. FETCH_ALL was never active (NEARBY is the only mode), and since #773 switched nearby sync to POST /geofences/nearest, the FETCH_ALL path was a dead bodyless POST.

  • GeofenceApiService.fetchGeofences now always sends the device location (no nullable-location branch).
  • The re-fetch rule (distance >= remoteFetchRefreshTriggerRadius) is inlined in GeofenceRepository; syncMode field/param dropped from the repository + DI.
  • RefreshAction moves to its own file; GeofenceSyncMode.kt + its test are deleted.

No runtime behavior change — NEARBY was already the only active mode. Net: main −33 LOC.

Notes

  • iOS drops its GET /geofences/nearby fetch-all path in a parallel change (same cleanup, other repo).

MBL-2008

PRs Stack


Note

Low Risk
Refactor and test cleanup only; production path already used NEARBY. Risk is mainly if anything external still depended on FETCH_ALL or nullable fetch APIs (none found in-module).

Overview
Removes the GeofenceSyncMode abstraction (FETCH_ALL / NEARBY) and standardizes on the nearby sync path that was already the only active mode.

GeofenceRepository no longer takes syncMode; the “re-fetch when device moves past remoteFetchRefreshTriggerRadius” rule lives in movedBeyondFetchRadius. Remote refreshes always pass device location into the API. RefreshAction is split into its own file; GeofenceSyncMode.kt and its unit test are deleted.

GeofenceApiService.fetchGeofences requires a non-null location and radiusMeters and always POSTs a JSON body to /geofences/nearest (the bodyless fetch-all branch is gone). DI wiring drops the sync-mode parameter.

Tests are renamed/consolidated around the single behavior; FETCH_ALL–specific cases and the “no body” API test are removed.

No intended runtime change for shipped SDKs—behavior matches former NEARBY / GeofenceSyncMode.active.

Reviewed by Cursor Bugbot for commit 05f0750. Bugbot is set up for automated code reviews on this repo. Configure here.

@mrehan27 mrehan27 requested a review from a team as a code owner July 9, 2026 15:18
@mrehan27 mrehan27 self-assigned this Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

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.


@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.76%. Comparing base (39a89fb) to head (05f0750).
⚠️ Report is 1 commits behind head on feature/geofence-on-device.

Files with missing lines Patch % Lines
.../kotlin/io/customer/geofence/di/DIGraphGeofence.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##             feature/geofence-on-device     #774      +/-   ##
================================================================
+ Coverage                         67.45%   67.76%   +0.30%     
- Complexity                         1123     1127       +4     
================================================================
  Files                               206      206              
  Lines                              6410     6400      -10     
  Branches                            890      888       -2     
================================================================
+ Hits                               4324     4337      +13     
+ Misses                             1776     1746      -30     
- Partials                            310      317       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
  • java_layout: mbl-2008-remove-geofence-fetch-all (1783610344)

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
  • kotlin_compose: mbl-2008-remove-geofence-fetch-all (1783610343)

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Build available to test
Version: mbl-2008-remove-geofence-fetch-all-SNAPSHOT
Repository: https://central.sonatype.com/repository/maven-snapshots/

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

📏 SDK Binary Size Comparison Report

Module Last Recorded Size Current Size Change in Size
core 43.85 KB 43.85 KB ✅ No Change
datapipelines 43.17 KB 43.17 KB ✅ No Change
messagingpush 31.66 KB 31.66 KB ✅ No Change
messaginginapp 123.88 KB 123.88 KB ✅ No Change
tracking-migration 22.89 KB 22.89 KB ✅ No Change
location 18.66 KB 18.66 KB ✅ No Change
geofence 70.36 KB 69.52 KB ⬇️ -0.84KB

@mrehan27 mrehan27 force-pushed the mbl-2008-geofence-nearest-geoset branch from aab2dff to aec4dfe Compare July 9, 2026 15:57
@mrehan27 mrehan27 force-pushed the mbl-2008-remove-geofence-fetch-all branch from cd08b4a to 625fe47 Compare July 9, 2026 15:57
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
  • java_layout: mbl-2008-remove-geofence-fetch-all (1783612833)

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
  • kotlin_compose: mbl-2008-remove-geofence-fetch-all (1783612811)

Base automatically changed from mbl-2008-geofence-nearest-geoset to feature/geofence-on-device July 10, 2026 15:11
FETCH_ALL was never active (NEARBY is the only mode) and, since the switch to
POST /geofences/nearest, its bodyless-POST path was dead code. Remove the
GeofenceSyncMode abstraction entirely: the device location is always sent, the
re-fetch rule is inlined in the repository, and RefreshAction moves to its own
file. iOS drops its GET /geofences/nearby fetch-all path in a parallel change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mrehan27 mrehan27 force-pushed the mbl-2008-remove-geofence-fetch-all branch from 625fe47 to 05f0750 Compare July 10, 2026 15:14
@mrehan27 mrehan27 merged commit b1e91c0 into feature/geofence-on-device Jul 10, 2026
38 checks passed
@mrehan27 mrehan27 deleted the mbl-2008-remove-geofence-fetch-all branch July 10, 2026 15:16
@github-actions

Copy link
Copy Markdown
  • java_layout: mbl-2008-remove-geofence-fetch-all (1783696545)

@github-actions

Copy link
Copy Markdown
  • kotlin_compose: mbl-2008-remove-geofence-fetch-all (1783696544)

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.

2 participants