BUILD FAILED - Multiple critical issues found: - Timeline.sendRaw() doesn't exist in SDK - Koios backend API usage wrong - DI import paths wrong - Parcelize imports wrong - Compose API mismatches See PHASE1-STATUS.md for full details and remediation plan.
182 lines
5.6 KiB
Markdown
182 lines
5.6 KiB
Markdown
# Phase 1 Status Report
|
|
**Date:** 2026-03-27
|
|
**Auditor:** Kayos (automated audit)
|
|
|
|
## Executive Summary
|
|
|
|
**BUILD STATUS: ❌ FAILED**
|
|
|
|
The Phase 1 code has fundamental issues that prevent compilation. The code makes API assumptions that don't match the actual Element X and cardano-client-lib APIs. This requires significant rework before it can be tested on device.
|
|
|
|
---
|
|
|
|
## Audit Findings
|
|
|
|
### Issues Fixed (Pushed to Gitea)
|
|
|
|
1. **DI Package Typo** ✅ FIXED
|
|
- `dev.zacsweeny.metro` → `dev.zacsweers.metro` (missing 's')
|
|
- Files: KoiosCardanoClient, DefaultTransactionBuilder, PaymentStatusPoller, WalletModule
|
|
|
|
2. **Missing Dependency** ✅ FIXED
|
|
- Added `implementation(projects.features.wallet.impl)` to messages:impl build.gradle.kts
|
|
|
|
3. **Event Type Inconsistency** ✅ FIXED
|
|
- Standardized to `co.sulkta.payment.request` everywhere
|
|
- Updated TimelineItemPaymentContent.EVENT_TYPE and tests
|
|
|
|
4. **Scope Inconsistency** ✅ FIXED
|
|
- PaymentStatusPoller changed from AppScope to SessionScope (matches CardanoClient scope)
|
|
|
|
5. **Sealed Interface Inheritance** ✅ FIXED
|
|
- TimelineItemPaymentContent can't inherit from sealed TimelineItemEventContent (different modules)
|
|
- Created TimelineItemPaymentContentWrapper adapter in messages:impl
|
|
|
|
6. **cardano-client-lib API** ✅ PARTIALLY FIXED
|
|
- Changed `getNetworks()` to `getNetwork()` returning `Network` instead of `Networks`
|
|
|
|
### Critical Issues Remaining (Blocks Compilation)
|
|
|
|
#### 1. DI Import Paths Wrong
|
|
**Impact:** ~20 compilation errors
|
|
**Files:** Most wallet/impl files
|
|
|
|
The code uses:
|
|
```kotlin
|
|
import dev.zacsweers.metro.SessionScope // WRONG
|
|
import dev.zacsweers.metro.Inject // WRONG
|
|
```
|
|
|
|
Should be:
|
|
```kotlin
|
|
import io.element.android.libraries.di.SessionScope
|
|
import javax.inject.Inject
|
|
```
|
|
|
|
**Status:** Partially fixed, but more instances remain
|
|
|
|
#### 2. Timeline.sendRaw() Doesn't Exist
|
|
**Impact:** Critical - payment sending broken
|
|
**Files:** DefaultPaymentEventSender.kt
|
|
|
|
The code assumes:
|
|
```kotlin
|
|
timeline.sendRaw(eventType, content) // DOESN'T EXIST
|
|
```
|
|
|
|
The Matrix Rust SDK's Timeline API doesn't expose raw event sending. The BLOCKERS.md claimed this was resolved in SDK version 26.03.24, but grep shows no `sendRaw` method in the Element X libraries/matrix module.
|
|
|
|
**Required Fix:** Either:
|
|
- Find the actual API for sending custom events (if it exists)
|
|
- Use a workaround (message with structured body?)
|
|
- Wait for SDK to add this capability
|
|
|
|
#### 3. Koios Backend API Wrong
|
|
**Impact:** Balance/UTxO fetching broken
|
|
**File:** KoiosCardanoClient.kt
|
|
|
|
The code uses:
|
|
```kotlin
|
|
BackendFactory.getKoiosBackendService() // DOESN'T EXIST
|
|
```
|
|
|
|
cardano-client-lib doesn't have a `BackendFactory` class. The actual API is:
|
|
```kotlin
|
|
val backendService = KoiosBackendService(CardanoNetworkConfig.KOIOS_BASE_URL)
|
|
```
|
|
|
|
#### 4. Parcelize Plugin Missing
|
|
**Impact:** ~15 compilation errors
|
|
**Files:** ParsedPayCommand.kt, PaymentEntryNode.kt, PaymentConfirmationNode.kt, PaymentProgressNode.kt
|
|
|
|
The build.gradle.kts has `id("kotlin-parcelize")` but the imports use wrong paths:
|
|
```kotlin
|
|
import kotlinx.parcelize.Parcelize // Correct
|
|
import android.os.parcelize.Parcelize // Used incorrectly in some places
|
|
```
|
|
|
|
#### 5. Compose API Mismatches
|
|
**Impact:** UI won't compile
|
|
**File:** PaymentConfirmationView.kt
|
|
|
|
```kotlin
|
|
Button(
|
|
onClick = { ... },
|
|
icon = { Icon(...) } // WRONG: Button doesn't have icon parameter
|
|
)
|
|
```
|
|
|
|
Element X's Button API differs from what was assumed.
|
|
|
|
#### 6. SeedPhraseManager ENGLISH Wordlist Reference
|
|
**Impact:** Mnemonic generation broken
|
|
**File:** SeedPhraseManager.kt
|
|
|
|
```kotlin
|
|
MnemonicCode.ENGLISH // DOESN'T EXIST
|
|
```
|
|
|
|
The correct API uses the MnemonicCode class differently.
|
|
|
|
---
|
|
|
|
## Architecture Assessment
|
|
|
|
### What's Correct
|
|
- Module structure (api/impl/test) follows Element X patterns
|
|
- Basic DI approach using Metro with @ContributesBinding
|
|
- Network configuration centralized in CardanoNetworkConfig
|
|
- Security design for key storage (Keystore, biometric, per-session)
|
|
- Timeline payment card concept
|
|
|
|
### What Needs Rework
|
|
1. **Payment Event Sending** - Fundamental approach needs re-evaluation since `sendRaw` doesn't exist
|
|
2. **Koios Client** - API usage completely wrong, needs rewrite to actual cardano-client-lib API
|
|
3. **Import Statements** - Systematic cleanup of DI and parcelize imports
|
|
4. **Compose Components** - Match Element X's actual component APIs
|
|
|
|
---
|
|
|
|
## Recommendations
|
|
|
|
### Immediate Actions Required
|
|
1. **Verify SDK Capabilities** - Check if Matrix Rust SDK actually supports custom event types at all. If not, Phase 1 needs fundamental redesign.
|
|
|
|
2. **Fix Koios Client** - Rewrite KoiosCardanoClient to use actual cardano-client-lib API:
|
|
```kotlin
|
|
val backendService = KoiosBackendService(CardanoNetworkConfig.KOIOS_BASE_URL)
|
|
val addressService = AddressService(backendService)
|
|
// etc.
|
|
```
|
|
|
|
3. **Element X API Review** - Before writing more code, do a thorough review of:
|
|
- Timeline event APIs
|
|
- Button/UI component APIs
|
|
- DI patterns used in existing features
|
|
|
|
### Phase 1 Assessment
|
|
|
|
**Ready for device testing?** ❌ NO
|
|
|
|
The code cannot compile. Estimated work to fix:
|
|
- Import cleanup: ~1 hour
|
|
- Koios client rewrite: ~2 hours
|
|
- Payment event sending redesign: ~4-8 hours (depends on SDK capabilities)
|
|
- UI component fixes: ~1 hour
|
|
- Testing: ~2 hours
|
|
|
|
**Total estimated fix time:** 10-14 hours of focused work
|
|
|
|
---
|
|
|
|
## Commits Made
|
|
|
|
1. `fix(wallet): resolve audit findings - DI typos, missing dependency, event type consistency`
|
|
2. `fix(wallet): resolve sealed interface inheritance issue`
|
|
3. `fix(wallet): fix cardano-client-lib API compatibility`
|
|
|
|
All changes pushed to `phase1-dev` branch on Gitea.
|
|
|
|
---
|
|
|
|
*Report generated automatically by Phase 1 audit subagent*
|