Skip to content

[Bug] secureStorage.ts continues app init even if critical security setup fails #789

Description

@RUKAYAT-CODER

Overview

secureStorage.ts catches errors from its initialisation routine but sets a success flag and allows the app to continue regardless of whether setup actually succeeded. An app running with a broken secure store will silently store tokens in plaintext.

Specifications

Features:

  • Make secure storage initialisation failures fatal — halt app startup with a clear error screen
  • Provide an explicit recovery path (e.g., "Clear app data and restart") for unrecoverable failures

Tasks:

  • Throw a fatal error from secureStorage.initialize() if setup fails
  • Add a StorageErrorScreen component that shows recovery instructions
  • Write a test that mocks the native module failure and confirms app halts

Impacted Files:

  • src/services/secureStorage.ts
  • src/screens/StorageErrorScreen.tsx (new)

Acceptance Criteria

  • Secure storage failure prevents app from starting in an insecure state
  • User sees a clear recovery instruction screen
  • Test confirms app halts on storage failure

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingsecuritySecurity vulnerability or concern

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions