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

@@ -32,9 +32,11 @@ import {
import { sessionsApi, type SessionInfo } from '@/lib/api/sessions';
import { motion } from 'framer-motion';
import { useLocalizedDate } from '@/hooks/useLocalizedDate';
import { useAuth } from '@/lib/auth/AuthContext';
export function SessionsManagement() {
const { formatDistanceToNow } = useLocalizedDate();
const { logout } = useAuth();
const [sessions, setSessions] = useState<SessionInfo[]>([]);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState<string | null>(null);
@@ -91,13 +93,16 @@ export function SessionsManagement() {
const response = await sessionsApi.revokeAllSessions();
setSuccessMessage(`${response.revokedCount} session(s) revoked successfully`);
setRevokeAllDialogOpen(false);
await loadSessions();
// Logout the current user since all sessions are revoked
// This clears tokens and redirects to login
await logout();
} catch (err: any) {
console.error('Failed to revoke all sessions:', err);
setError(err.response?.data?.message || 'Failed to revoke sessions');
} finally {
setIsRevokingAll(false);
}
// Note: Don't set isRevokingAll to false here, as we're logging out
};
const getPlatformIcon = (platform?: string) => {