Claude-skill-registry Debug Data Loss
DEBUG mysteriously disappearing tasks using the taskDisappearanceLogger. Use when tasks vanish without user deletion, data seems to be lost, or you need to track what's modifying the task array. Provides comprehensive logging of all task array operations.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/dev-debug-data-loss" ~/.claude/skills/majiayu000-claude-skill-registry-debug-data-loss && rm -rf "$T"
skills/data/dev-debug-data-loss/SKILL.mdDebug Data Loss
When to Use This Skill
Activate this skill when:
- Tasks are mysteriously disappearing without user deletion
- Data loss is suspected but can't be reproduced
- You need to track what code paths are modifying
tasks.value - Cross-tab sync or undo/redo is suspected of causing data loss
Task Disappearance Logger
Location:
src/utils/taskDisappearanceLogger.ts
The logger tracks all modifications to the task array and identifies when tasks disappear without explicit user deletion.
Current Status
The logger is auto-enabled on app startup (added for BUG-020 investigation).
- Auto-enable code:
(lines 74-79)src/main.ts - Periodic snapshots every 30 seconds when enabled
- Persists logs to localStorage
Browser Console API
// Enable/Disable monitoring window.taskLogger.enable() window.taskLogger.disable() // Check for disappeared tasks (most important!) window.taskLogger.getDisappearedTasks() // Get summary of all logging window.taskLogger.printSummary() // Search for a specific task in history window.taskLogger.findTaskInHistory("task title or id") // Get all logs window.taskLogger.getLogs() // Get all snapshots window.taskLogger.getSnapshots() // Export logs for analysis window.taskLogger.exportLogs() // Clear all history window.taskLogger.clearHistory()
What Gets Logged
The logger wraps all
tasks.value = assignments in these files:
| File | Operations Logged |
|---|---|
| All task array replacements (12 locations) |
| Cross-tab delete operations |
| Auto-enable on startup |
Log Sources
Each log entry includes a
source field identifying where the change occurred:
| Source | Description |
|---|---|
| Task array loaded from database |
| Restored from user backup |
| Restored from import |
| Sample tasks created for new users |
| Error recovery operations |
| Direct debug load operations |
| Undo operation |
| Emergency restore after failed undo |
| Cross-tab sync deleted a task |
| Cross-tab sync bulk delete |
| User-initiated delete (marked as intentional) |
Analyzing Disappearances
When a task disappears, the logger records:
interface DisappearedTask { task: { id, title, status, projectId } disappearedAt: number // Timestamp when it vanished lastSeenAt: number // Timestamp of last snapshot containing it lastSeenSource: string // What operation was happening disappearedDuring: string // What operation caused disappearance stackTrace?: string // JavaScript stack trace wasUserDeletion: boolean // false = suspicious disappearance }
Debugging Workflow
-
Enable logging (auto-enabled for BUG-020):
window.taskLogger.enable() -
Use the app normally - reproduce the issue if possible
-
Check for disappeared tasks:
const disappeared = window.taskLogger.getDisappearedTasks() console.log(disappeared) -
Analyze the source:
- Look at
to see what operation caused itdisappearedDuring - Check
to see the exact code pathstackTrace - Compare
vslastSeenSourcedisappearedDuring
- Look at
-
Export for detailed analysis:
const logs = window.taskLogger.exportLogs() // Copy/paste to a file for analysis
Removing Auto-Enable
Once BUG-020 is resolved, remove auto-enable from
src/main.ts:
// DELETE these lines (around lines 74-79): setTimeout(() => { taskDisappearanceLogger.enable() console.log('%c[TASK-LOGGER] Auto-enabled for BUG-020 investigation', 'color: #4CAF50; font-weight: bold') }, 2000)
Related
- BUG-020: Tasks randomly disappearing without user deletion
- TASK-022: Task Disappearance Logger & Investigation
- TASK-024: Review Task Disappearance Logs (scheduled review)
- Skill:
- General task store debuggingdev-fix-task-store