Main latest backup
{userId}/backups/latest.json
Data safety first
Sync checks cloud first. If this device is empty but cloud has tasks, sessions, subjects, habits, exams, tests, or mock tests, IsotopeAI restores cloud before it uploads.
Source of truth
New writes go to canonical backup paths. Old import/export folders are still read so older users can recover data.
{userId}/backups/latest.json
{userId}/backups/history/{timestamp}-{hash}.json
{userId}/cloud-snapshot/latest.json
Restore rule
The app checks tasks, sessions, subjects, habits, daily logs, tests, exams, mock tests, and timer state.
A rich backup wins over a newer empty profile-only backup.
Fresh browsers must download and apply cloud data before writing canonical latest.
BLOCKED_EMPTY_OVERWRITEThis code means cloud has richer data and the empty device is not allowed to replace it.
These are read for compatibility and can be promoted if they are best.
{userId}/imports/latest.json
{userId}/exports/latest.json
{userId}/cloud-snapshot/latest.json
Use these from the repo root when you need proof.
node scripts/repair-user-backup.mjs --user <id> --dry-run node scripts/prove-new-browser-restore.mjs node scripts/validate-storage-cleanup.mjs --user <id> --dry-run