fix: Fix 3 critical bugs - voice tracking, session persistence, and status updates
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

BUG-1: Voice tracking not saving activities
- Fix activity data format to match backend CreateActivityDto
- Change 'timestamp' to 'startedAt' and 'data' to 'metadata'
- Remove duplicate voice button from mobile TabBar

BUG-2: Session persistence after revocation
- Add logout() call when revoking all sessions
- Add logout() call when removing all devices
- Ensures user is logged out after session/device revocation
- Clears tokens and redirects to login

BUG-3: Voice modal status not updating
- Set identifiedActivity before saving to show tracker name
- Display "Adding to [tracker] tracker..." during save
- Improves UX by showing which tracker is being updated

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-04 06:19:09 +00:00
parent e2ca04c98f
commit 2ab98746da
5 changed files with 22 additions and 36 deletions

View File

@@ -36,8 +36,10 @@ import {
import { devicesApi, type DeviceInfo } from '@/lib/api/devices';
import { motion } from 'framer-motion';
import { useLocalizedDate } from '@/hooks/useLocalizedDate';
import { useAuth } from '@/lib/auth/AuthContext';
export function DeviceTrustManagement() {
const { logout } = useAuth();
const { formatDistanceToNow } = useLocalizedDate();
const [devices, setDevices] = useState<DeviceInfo[]>([]);
const [isLoading, setIsLoading] = useState(true);
@@ -112,13 +114,16 @@ export function DeviceTrustManagement() {
const response = await devicesApi.removeAllDevices();
setSuccessMessage(`${response.removedCount} device(s) removed successfully`);
setRemoveAllDialogOpen(false);
await loadDevices();
// Logout the current user since all devices are removed
// This terminates all sessions and redirects to login
await logout();
} catch (err: any) {
console.error('Failed to remove all devices:', err);
setError(err.response?.data?.message || 'Failed to remove devices');
} finally {
setIsRemovingAll(false);
}
// Note: Don't set isRemovingAll to false here, as we're logging out
};
const getPlatformIcon = (platform?: string) => {