mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 18:19:43 +00:00
Fix Android navigation and enforce secure-only messaging
- Remove forced redirect to pairing screen for users without a couple - Users now go directly to dashboard after onboarding (matches iOS behavior) - Add secureReady state to InputBar to prevent sending before E2EE is ready - Pre-fetch admin key during key initialization to reduce chat load time - Block media uploads until encryption is fully ready - Add security status indicator in chat when encryption is initializing
This commit is contained in:
1 parent
4b8f4315e9
commit
953bd7c03d
7 files changed
+357
-177
No files matched your search
@@ -13,7 +13,7 @@ import { Platform } from 'react-native';
|
||||
import { useEncryptionKeys } from '../hooks';
|
||||
import { useAuthStore } from '../store';
|
||||
import { reencryptPendingMessages } from '../lib/encryption/reencryptPendingMessages';
|
||||
import { triggerKeyRotation } from '../lib/encryption';
|
||||
import { triggerKeyRotation, getAdminPublicKey } from '../lib/encryption';
|
||||
import { LoadingOverlay } from './ui/LoadingOverlay';
|
||||
import { colors } from '../theme';
|
||||
|
||||
@@ -97,6 +97,16 @@ export function EncryptionKeyInitializer(): JSX.Element | null {
|
||||
|
||||
console.log('[E2EE Init] Encryption keys initialized and uploaded');
|
||||
|
||||
// Pre-fetch admin key to warm the cache before user reaches chat
|
||||
// This reduces the delay before secureReady becomes true
|
||||
try {
|
||||
await getAdminPublicKey();
|
||||
console.log('[E2EE Init] Admin key pre-fetched successfully');
|
||||
} catch (adminKeyError) {
|
||||
// Non-fatal: admin key will be fetched again when needed
|
||||
console.warn('[E2EE Init] Failed to pre-fetch admin key:', adminKeyError);
|
||||
}
|
||||
|
||||
// Track if keys were regenerated (for rotation decision)
|
||||
if (result.wasRegenerated) {
|
||||
console.log('[E2EE Init] Keys were regenerated this session');
|
||||
|
||||
Reference in new issue
Block a user