Skip to content

🟡 MEDIUM: Standardize on async/await throughout codebase #215

@arkavo-com

Description

@arkavo-com

Problem

The codebase mixes completion handlers and async/await patterns inconsistently.

Examples

// AuthenticationManager.swift - closure-based
func registrationOptions(accountName: String, completion: @escaping (Data?, Data?) -> Void)

// ArkavoApp.swift - async/await
private func saveProfile(profile: Profile) async -> Bool

Impact

  • Callback hell in some code paths
  • Inconsistent error handling patterns
  • Difficulty composing async operations
  • Mental overhead switching between patterns

Solution

  1. Convert all completion handlers to async/await
  2. Use withCheckedContinuation for bridging legacy APIs
  3. Standardize error handling with throws
  4. Update all call sites

Files to Update

  • AuthenticationManager.swift - Multiple completion handlers
  • ArkavoClient callbacks
  • Network layer methods

Acceptance Criteria

  • All public APIs use async/await
  • No completion handlers in new code
  • Consistent throws for error handling
  • Legacy bridging documented where needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions