Files
accounted/lib/import
Jakob Wennberg ae17b304d7 fix(import): add stable .order() to account-sync chart paging (#790, #791 follow-up) (#812)
`syncMappedAccounts` pages the company's full chart via `fetchAllRows` to avoid
the silent 1000-row PostgREST cap, but the query had no `.order()`. Like the
report queries fixed in #811, PostgREST `.range()` paging is only correct with a
stable total order — without it, a chart larger than one page could duplicate or
skip accounts across page boundaries, corrupting the existing-account Map and
causing spurious create/update churn on import.

Order on the unique `account_number` (stable total order; the result is read
into a Map so the order is invisible to callers). Extend the test mock's query
chain to include `.order()`.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 13:42:41 +02:00
..
2026-06-05 17:26:40 +02:00
2026-05-08 15:42:06 +02:00
2026-05-08 15:42:06 +02:00
2026-06-18 11:49:33 +02:00