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

@@ -173,11 +173,12 @@ export function VoiceFloatingButton() {
const childId = children[0].id;
console.log('[Voice] Using child ID:', childId);
// Create the activity
// Create the activity - match backend CreateActivityDto format
const activityData = {
type: activityType,
timestamp: activityTimestamp || new Date().toISOString(),
data: activityDetails,
startedAt: activityTimestamp ? new Date(activityTimestamp).toISOString() : new Date().toISOString(),
endedAt: activityDetails.endedAt || undefined,
metadata: activityDetails,
notes: activityDetails.notes || undefined,
};
@@ -213,6 +214,7 @@ export function VoiceFloatingButton() {
const handleApprove = async (data: any) => {
try {
setIsProcessing(true);
setIdentifiedActivity(data.type); // Set the activity type for display
setProcessingStatus('saving');
setShowReview(false);
@@ -249,6 +251,7 @@ export function VoiceFloatingButton() {
const handleEdit = async (editedData: any) => {
try {
setIsProcessing(true);
setIdentifiedActivity(editedData.type); // Set the activity type for display
setProcessingStatus('saving');
setShowReview(false);