Skip to content

Privacy-safe ORS analytics and remove GPX logging - #99

Merged
Pygmalion69 merged 1 commit into
masterfrom
codex/implement-ors-analytics-and-privacy-cleanup
Sep 21, 2026
Merged

Pygmalion69 merged 1 commit into
masterfrom
codex/implement-ors-analytics-and-privacy-cleanup

Conversation

@Pygmalion69

Copy link
Copy Markdown
Owner

Motivation

  • Add low-cardinality, privacy-preserving analytics for ORS routing and place search while ensuring the FOSS flavor remains a true no-op.
  • Replace ambiguous/identifying telemetry and remove sensitive Logcat output that emitted full GPX geometry.
  • Provide deterministic helpers and stable error classification so analytics remain testable and robust across ORS/Retrofit failures.

Description

  • Introduces typed ORS analytics enums and helper functions in OrsAnalytics.kt for outcomes, start source, duration/query-length/result-position bucketing, and error classification.
  • Replaces the legacy route_calculated surface with ors_route_result, refactors the Directions.getRouteGpx callback to distinguish success, empty, and classified error outcomes, and emits the new analytics with profile, destination_count, start_source, duration_bucket and optional error_category (no raw messages, no geometry).
  • Instruments place-search flows: adds a lifecycle-safe ors_search_opened when the dialog is first shown, records ors_search_result around the actual autocomplete call with timing, is_retry flag and query-length bucketing, and records ors_search_selection using list index and displayed count; preserves CancellationException behavior and does not emit analytics for cancelled/superseded requests.
  • Updates the analytics abstraction (AnalyticsTracker) with explicit typed methods and keeps NoOpAnalyticsTracker for FOSS, and updates the Play FirebaseAnalyticsTracker to log only the specified low-cardinality parameters (removes filename logging and the old waypoint parameter).
  • Removes full GPX Logcat output and replaces it with a non-sensitive length-only debug message; route error user-visible text is localized and generic (no exception text).
  • Adds unit tests for helper bucketing and error classification (OrsAnalyticsTest) and extends PlaceSearchViewModelTest to validate analytics emission for success/empty/error/retry and that cancelled requests do not emit failures using an injected recording tracker.

Testing

  • Ran a repository sanity check: git diff --cached --check (no staged whitespace/errors reported).
  • Privacy scan for sensitive logging and legacy event names: rg -n 'Log\.(d|e).*?(GPX:|query|coordinate|api.?key)|route_calculated' app/src/main/java app/src/play/java -i produced no matches, confirming removal of full-GPX logging and legacy route_calculated usage.
  • Attempted CI-style validation with Gradle: ./gradlew testFossDebugUnitTest --no-daemon, ./gradlew assembleFossDebug --no-daemon, and ./gradlew assemblePlayDebug --no-daemon but these could not complete in this environment due to missing Android SDK configuration (ANDROID_HOME/ANDROID_SDK_ROOT unset), so unit/integration builds were not executed here.
  • Local unit tests added under app/src/test (helper and extended ViewModel tests) are present and designed to run in CI; they could not be executed here for the same SDK/environment limitation but are self-contained and do not require Firebase.

If you want, I can open a PR with this branch metadata or run the Gradle tasks in an environment with an Android SDK configured to execute the unit/build validation.


Codex Task

@Pygmalion69
Pygmalion69 merged commit 04b4d2f into master Sep 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant