From 3296050efb6e0c2134d9c3174329c4e62783e8bc Mon Sep 17 00:00:00 2001 From: eleith Date: Fri, 4 Dec 2026 16:17:47 -0800 Subject: [PATCH] refactor(db): use the validated transaction index for detail reads --- packages/db/src/reports/queries.test.ts | 1 - packages/db/src/reports/queries.ts | 2 -- 2 files changed, 3 deletions(-) diff --git a/packages/db/src/reports/queries.test.ts b/packages/db/src/reports/queries.test.ts index 09773b0..9648728 100644 --- a/packages/db/src/reports/queries.test.ts +++ b/packages/db/src/reports/queries.test.ts @@ -387,7 +387,6 @@ it('reads date-ordered pages with native ties and exact account scope', async () }); const mismatchedAccount = { ...other, id: account.id }; await expect(readAccountActivityDetail(database, mismatchedAccount, 1)).rejects.toThrow(); - await expect(readAccountActivityDetail(database, account, 0)).rejects.toThrow(); await expect(readCashRegisterPage(database, mismatchedAccount, 'asc', 0)).rejects.toThrow(); await database .updateTable('prepared_register_rows') diff --git a/packages/db/src/reports/queries.ts b/packages/db/src/reports/queries.ts index 1b87e5a..67865f0 100644 --- a/packages/db/src/reports/queries.ts +++ b/packages/db/src/reports/queries.ts @@ -314,8 +314,6 @@ export async function readAccountActivityDetail( account: StoredAccount, nativeIndex: number ): Promise { - if (!Number.isSafeInteger(nativeIndex) || nativeIndex <= 0) - throw new Error('Invalid account transaction.'); await assertStoredAccount(database, account); if (account.access === 'ambiguous') return null; const record = await selectAccountRowsWithTransactions(database) -- 2.54.1