Skip to content

[History] 3 - Pin favorited telemetry #289

Description

@KacperKozak

Parent

What to build

Favorites pin their telemetry ranges (ADR 0029). Telemetry deletion — delete ride/range and clear history — carves out favorited ranges instead of deleting them, on both platforms. The carve-out is pure range-subtraction logic extracted per ADR 0010 and unit-tested. Deleting a ride around a Favorite leaves the favorited samples as a telemetry island, which history grouping surfaces as a short standalone ride. History rows whose span intersects a Favorite show a marker that the ride cannot be fully deleted. Removing a Favorite only unpins: its telemetry stays and becomes normally deletable.

Likely files

  • modules/vescape-core/ios/telemetry/TelemetryRepository.swift - iOS delete paths to carve
  • modules/vescape-core/ios/telemetry/TelemetryDao.swift - range delete queries
  • modules/vescape-core/android/src/main/java/expo/modules/vescapecore/telemetry/TelemetryRepository.kt - Android peer delete paths
  • modules/vescape-core/android/src/main/java/expo/modules/vescapecore/telemetry/TelemetryDao.kt - Android peer DAO
  • src/modules/history/lib/sessions.ts - derive "contains favorite" for history rows
  • src/modules/history/components/HistorySessionSheet.tsx - delete action + protection marker UI

Implementation hints

  • Extract range subtraction as a pure function (given delete range + favorited ranges, return sub-ranges to actually delete) and test it in isolation on both platforms; edge cases: full overlap, partial overlap at each edge, favorite spanning multiple delete ranges, adjacent-but-disjoint.
  • Clear-all history is just the full range through the same carve-out.
  • Minute buckets covering a carved boundary need consistent handling with existing partial-range deletes — inspect how deleteTelemetryRange treats buckets today before choosing.
  • "Contains favorite" derivation belongs with session grouping (JS) from the favorites list already loaded by slice 1's store — no new bridge call needed.

Acceptance criteria

  • Pure range-subtraction logic with unit tests on iOS and Android (@parity)
  • Deleting a ride containing a Favorite keeps the favorited sub-range
  • Clear history keeps all favorited ranges
  • Leftover favorited island appears as a short standalone ride in History
  • History rows intersecting a Favorite show a cannot-fully-delete marker
  • Deleting a Favorite unpins only; its telemetry then deletes normally

Blocked by

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:historyRide history, sessions, buckets, graphscomplexity:mediumNeeds care, moderate integration surface. Use sonnet.ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions