Handle Unregistered Mode Separately from Offline Mode
- Dominant language
- Swift
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 41m
- Merged PRs (30d)
- 1
Description
# Handle Unregistered Mode Separately from Offline Mode
## Problem Description
Currently, when a user has a local account that doesn't exist on the server (e.g., after restoring from backup or using a new server), the app treats this as "Offline Mode". This is confusing because:
1. The app **can** connect to the server successfully
2. The server is responding properly
3. The issue is specifically that the user account doesn't exist on the server
## Current Behavior
When `ArkavoApp.checkAccountStatus()` runs:
- If local account exists but server returns "User Not Found"
- App sets `sharedState.isOfflineMode = true`
- User sees "Offline Mode" screen suggesting network issues
## Expected Behavior
Create a distinct "Unregistered Mode" that:
- Clearly indicates the account exists locally but not on server
- Offers options to:
- Register the existing account on the server
- Create a new account
- Continue in local-only mode
- Doesn't imply network connectivity issues
## Implementation Notes
### Code Location
- `ArkavoApp.swift:601-620` - Where "User Not Found" error is handled
- Need new state: `sharedState.isUnregisteredMode`
- New view: `UnregisteredModeView`
### Suggested Flow
```swift
if case let .authenticationFailed(message) = error, message.contains("User Not Found") {
// User exists locally but not on server
print("User exists locally but not on server - entering unregistered mode")
sharedState.isUnregisteredMode = true
selectedView = .unregistered
}
```
### New View Components
- `UnregisteredModeView` explaining the situation
- Options to register existing profile or create new
- Clear messaging that network is working fine
## Benefits
- Better user experience with clear communication
- Distinguishes between network issues and account issues
- Allows users to recover without clearing app data
- Supports offline-first architecture while maintaining server sync
## Testing
- Test with local account that doesn't exist on server
- Verify clear messaging and recovery options
- Ensure smooth transition to registered state
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in ArkavoApp.swift:601-620, where the "User Not Found" authentication failure is handled, and trace the existing account-status state and view selection. Add the requested unregistered state and UnregisteredModeView with the three recovery options and clear messaging. Test with a local account absent from the server, verifying the recovery options and transition to registered state.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- authentication, mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100