mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
Import-correctness and import-hardening fixes across the client (IndexedDB) and worker import paths. - Locale-aware amounts (I1): the generic/Google-Sheets import parsed amounts with bare parseFloat, so a European "1.234,56" became 1.234 — a 1000x understatement that then adjusted the balance. Both sides now parse with the last-separator-wins convention (handles "1.234,56" and "1,234.56"), matching the dedicated bank importers. The duplicate check uses the same parser so a locale-formatted amount matches the stored value. - Robust dates (I2/I3): ambiguous nn/nn/yyyy is resolved by range (a field > 12 can only be the day; both <= 12 defaults to day-first for this EU-focused app), so US "04/13/2026" parses to 2026-04-13 instead of being dropped — and the worker no longer rolls a month > 12 into the next year. Dates are formatted from explicit y/m/d parts (local for typed dates, UTC for Excel serials) instead of toISOString(), removing the off-by-one-day between importers. - Dedup null guard: a stored transaction with a null description no longer throws and aborts the whole import. (Account/type-aware dedup needs dedup moved after account resolution — left as a follow-up.) - Import session store (I6): random ids via crypto.randomUUID and TTL/size eviction so the in-memory session map can't grow unbounded. - Upload size cap (S8): both sides reject an over-10MB import file before parsing it in memory. - Google-Sheets CORS proxy (S5): the third-party corsproxy.io is now a lazy last-resort fallback instead of the first strategy, so the user's sheet goes direct to Google on the happy path rather than through an external service. Tests: worker date/amount/size-cap regression tests; client parsing tests for the amount and date matrices.