Skip to content

[Core] 1 - Test recording across hosts #461

Description

@KacperKozak

What to build

Extract production persistence dependencies into host-runnable Room JVM and macOS GRDB modules. Deliver one shared recording scenario: write moving samples, commit, close/reopen, and read the same ride on both platforms. Keep OS lifecycle and Expo wiring in platform adapters. Establish a small shared fixture format with explicit expected results and identical scenario coverage; do not build a generic framework.

Part 1 of the approved cross-platform persistence reliability plan. Android and iOS remain separate native implementations with shared observable contracts. Local planning document: docs/persistence-reliability-plan.md; this issue is self-contained. Type: AFK.

Likely files

  • modules/vescape-core/Package.swift - host test/build entry point
  • modules/vescape-core/android/build.gradle - host test/build entry point
  • modules/vescape-core/ios/telemetry/TelemetryDatabase.swift - production behavior or caller to inspect
  • modules/vescape-core/ios/telemetry/TelemetryDao.swift - production behavior or caller to inspect
  • modules/vescape-core/android/src/main/java/expo/modules/vescapecore/telemetry/TelemetryDatabase.kt - production behavior or caller to inspect
  • scripts/test-ios.ts - host test/build entry point

Implementation hints

Keep Room on Android and GRDB on iOS. Native owns durable truth; JS renders state and sends intents. Follow bidirectional @parity links and preserve bridge payloads. Custom SQL is allowed for migrations and aggregate updates with real DB tests. Use existing error UI and avoid a generic persistence/recovery framework. Diagnostics transport follows ADR 0031; Sentry handles errors independently of local event persistence. Use bun commands and appropriate scoped verification.

Acceptance criteria

  • Host tests execute production repositories, generated DAOs and real SQLite, without Android emulator or iOS simulator.
  • Original malformed iOS inserts fail the recording contract; corrected writes pass. Compare against explicit expected values, not just agreement between two implementations.
  • File-backed close/reopen works; missing scenarios fail either runner. Report measured cold/warm runtime.
  • Keep production schema and restore compatibility; document driver/version differences and extraction boundaries.

Blocked by

None - can start immediately

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:coreApp shell, storage, lifecycle, infraarea:dbTouches database / persistent storagearea:nativeTouches native side (modules/vesc-ble, Swift/Kotlin)complexity:highCritical paths, subtle correctness, native pipelines. Use opus.enhancementNew feature or requestready-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