You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: propagate backfilled cwd/source_file across devices (#12)
Cross-device project stats lost Codex (and other cwd-dependent) projects
on the device running `aiusage serve`: synced records carried no cwd and
no source_file, so /api/projects skipped them entirely.
Root cause: the cwd/source_file backfills enriched local records but did
not bump `updated_at`. Cross-device propagation only re-uploads records
where `updated_at > synced_at`, and the remote merge only overwrites when
the incoming updatedAt is strictly newer — so the enriched fields never
reached peers. backfillCodexModels already bumps updated_at; the cwd and
hermes source_file backfills were the inconsistent siblings.
- Extract the cwd backfill into backfillCwd and bump updated_at (matching
backfillCodexModels); also bump in the per-file cwd write and in
backfillHermesSourceFiles.
- Add migration v12 to repair users who already ran the buggy v1.5.0–v1.5.7
backfill: their cwd is already populated locally, so the corrected
`WHERE cwd = ''` backfill no longer matches them — the migration re-marks
enriched records as changed to force one re-upload. It is required, not
optional, for existing installs.
- Tests for both the backfill bump and the v12 repair.
0 commit comments