Skip to content

[Core] 5 - Protect Tune and alert storage #465

Description

@KacperKozak

What to build

Extend shared contracts across Tune Profile saves, Tune History, and durable Alert configuration. Migrate ordinary iOS writes to GRDB records while retaining native Board configuration ownership and existing successful behavior.

Part 5 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/ios/telemetry/TuneProfileStore.swift - production behavior or caller to inspect
  • modules/vescape-core/ios/telemetry/TuneProfileStoreTests.swift - existing verification seam
  • modules/vescape-core/ios/telemetry/AppDataRepository.swift - production behavior or caller to inspect
  • modules/vescape-core/android/src/main/java/expo/modules/vescapecore/telemetry/AppDataRepository.kt - production behavior or caller to inspect
  • modules/vescape-core/src/index.ts - native bridge contract

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

  • Both platforms preserve Tune values/history and Board-owned Alert data across update and reopen.
  • Atomic operations roll back on injected failures; callers receive explicit errors and established Sentry reporting.
  • No failed read becomes default config or successful save. No changes to firmware commands or riding feedback semantics.
  • Inspect actual peer stores and preserve native/TS contracts and existing relevant ADRs.

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: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