Skip to content

Feat/location ping - #56

Merged
Shakibuzzaman3104 merged 9 commits into
mainfrom
feat/location-ping
Nov 8, 2026
Merged

Shakibuzzaman3104 merged 9 commits into
mainfrom
feat/location-ping

Conversation

@zakaria5729

Copy link
Copy Markdown
Collaborator

What

One or two sentences on what changed and why (the "why" matters more than the "what" — the diff
already shows the what).

Verification

Which ./gradlew commands did you run, and what did they confirm? (See
CONTRIBUTING.md for the standard set.)

  • ./gradlew testDebugUnitTest — passing
  • ./gradlew ktlintCheck detekt — clean (or new detekt findings are justified, not baselined away)
  • ./gradlew apiCheck — clean, or apiDump is included in this diff because the public API changed
  • If this touches a debug/release or protected-variant boundary: sample assemble/verify commands
    run for the affected sample(s) (:samples:<name>:assembleRelease :samples:<name>:verifyDevConsoleProtectedArtifacts)

Checklist

  • Capture-path code (network/socket/push) never throws into the host app
  • No new sensitive data is captured, logged, or exported without going through
    RedactionEngine first
  • Docs updated if behavior, an API, or a config field changed
    (see docs/README.md for the index)
  • This PR is scoped to one logical change

Anything reviewers should look at closely

Optional — call out anything you're unsure about, a tradeoff you made, or a spot you want a second
look at.

Adds NetworkTransactionRecorder.withCompletionObserver(...). The observer
gets every completed request with its raw body and status before capture
rules and redaction run, so a feature can react to traffic the capture
rules exclude. Provisional streaming records are skipped so a request is
only reported once.
New sdk:location-ping module. The host describes its ping endpoints
(LocationPingStream) and the body shape (LocationPingSchema), and
LocationPingStore appends matching request bodies as JSON lines, one file
per stream, group id and day. It enforces a storage cap, rejects path
traversal in stream and file names, and reads a track back as points
ordered by device time with device and fix time gaps.

Pings can be answered, dropped on device or never sent, and each outcome
is kept with the ping.
GET /api/v1/location-pings lists streams, schema hints, storage use and
recorded tracks. GET /api/v1/location-pings/track returns one track's
points with a status the map can colour (sent, failed, dropped, offline).
PUT /streams/{name} switches a stream on or off, and the DELETE routes
remove a track or everything.

Mutations need the CSRF token and are written to the audit log, and all
routes sit behind the network capture category. The engine takes the
store through withLocationPings so its constructor ABI is unchanged.
Replays a recorded track on an OpenStreetMap map. Each ping is a dot
coloured by its outcome, the route runs through them in device-time
order, and the first and last pings are ringed. The view has recording
switches per stream, status and app-state filters, device and fix time
gap labels, a ping list, a details dialog with copy as JSON, a route
summary, auto-refresh, and delete track / delete all.

Leaflet 1.9.4 ships with the dashboard (BSD-2, licence alongside). The
CSP allows images from tile.openstreetmap.org and nothing else, and the
OSM credit sits in the map legend.
DevConsoleConfig.withLocationPingTracking(...) (and the Builder's
locationPingTracking) registers the ping streams and body schema. The full
runtime keeps the store in app-private files, remembers each stream's
switch in SharedPreferences, and records every matching request that goes
through the OkHttp interceptor. A request that fails before a response
counts as offline.

DevConsole.recordLocationPing(...) covers pings the app drops or cannot
send, and isLocationPingTrackingEnabled(...) reports whether a stream is
recording. Both are gated by the network capture category, and the no-op
runtime answers false.
The in-app inspector's More screen lists each configured stream with a
switch, so a tester can start or stop recording on the phone without
opening the dashboard. The list is empty, and the group hidden, when no
streams are configured or network capture is off.
Registers a "ride" stream and adds a Send location ping button. Each tap
moves 120 m along a route and cycles through the four outcomes: 200 and
401 go through OkHttp, answered by mock rules, while dropped and offline
are reported with DevConsole.recordLocationPing.
Adds docs/LOCATION_PINGS.md (setup, schema, storage, dashboard, security),
the protocol reference for the new routes, a README row and a changelog
entry.
# Conflicts:
#	samples/views-java-app/src/main/java/io/devconsole/sample/viewsjava/MainActivity.java
#	sdk/api/api/api.api
#	sdk/full/src/main/kotlin/io/devconsole/FullInspectorDataSource.kt
#	sdk/full/src/main/kotlin/io/devconsole/PlatformFacadeProvider.kt
#	sdk/server-ktor/api/server-ktor.api
#	sdk/server-ktor/src/main/resources/devconsole-web/dashboard.css
#	sdk/server-ktor/src/main/resources/devconsole-web/index.html
#	sdk/ui-compose/api/ui-compose.api
#	sdk/ui-compose/src/main/kotlin/io/devconsole/ui/compose/InspectorDataSource.kt
#	sdk/ui-compose/src/main/kotlin/io/devconsole/ui/compose/InspectorMoreScreen.kt
@Shakibuzzaman3104
Shakibuzzaman3104 merged commit fa6acfe into main Nov 8, 2026
1 check passed
Shakibuzzaman3104 added a commit that referenced this pull request Nov 8, 2026
Bring in the location ping tracker from #56 alongside this branch's capture
controls, retained run tools and dashboard hardening.

- Keep both sides of the facade, dashboard, inspector and API additions
- Read the location ping toggle body through receiveTextWithin
- Carry locationPingStreams through withSnapshot
- Move withSnapshot out of InspectorViewModel to stay under the class size limit
- Regenerate the binary compatibility snapshots
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