fix(stats): preserve pruned first_seen and stamp seen_ms at observation

- Record occurrence seen_ms from the observation time instead of flush time
- On session delete, only move first_seen when removed timestamps prove it was deleted; keep earlier dates from retention-pruned or legacy history
- Exact refresh fallback keeps subtraction-exact frequency and preserved first_seen
- Add tests for pruned history, legacy rows, and delayed flushes; update docs and change fragments
This commit is contained in:
sudacode committed 2026-10-02 22:19:28 -07:00
1 parent 009519a006
commit c149746548
7 files changed
+179 -44

No files matched your search

+1 -1
View File
@@ -2,6 +2,6 @@ type: fixed
area: stats
- Fixed sentence mining (single and multi-line) counting each created card twice in session and lifetime stats.
- Fixed deleting a session leaving word and kanji "last seen" dates pointing at the deleted session; affected rows are repaired once in the background on next launch.
- Fixed word and kanji dates after session deletion. Historical "first seen" dates and counts survive retention pruning; new occurrences record observation time so deletion can update dates exactly. Legacy earlier dates are preserved when the remaining history cannot prove their origin. Stale "last seen" dates are repaired once in the background on next launch.
- Fixed re-seen words that the vocabulary filter hides still being counted in the new-words charts, so charts and the vocabulary summary now agree. Existing mismatches are repaired by the same background pass.
- Fixed Overview totals, charts, activity calendar, and vocabulary summary staying stale after deleting sessions. Failed refreshes keep the dashboard visible and offer a retry.