fix(transactions): drop suppressed transactions from the transactions page #19
Reference in New Issue
Block a user
Delete Branch "worktree-revert-include-in-reports"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Suppressed transactions were showing up on the transactions page.
The cause
The SSR transactions page never excluded
:transaction-approval-status/suppressed. The GraphQL/CLJS transactions page has always excluded them unconditionally (auto_ap/datomic/transactions.clj, thetruebranch of itscond->>), as do the ledger queries inauto_ap/ledger.clj.The
scan-transactionsion does no status filtering of its own — it is a bareindex-rangeover:transaction/client+date— so nothing downstream was dropping them either. Suppressing a transaction is the user's way of saying "stop showing me this", and it stayed visible on the page it was suppressed from.Impact
22,813 suppressed transactions exist db-wide out of 621,492. For the worst-affected client, a five-year range returned 14,736 rows against 3,641 real ones — the other 11,095 were suppressed.
The fix
One
notclause in the main scan inauto_ap/ssr/transaction/common.clj, applied inside the query rather than after it so the row count and the amount total — both derived fromfetch-ids— match the rows actually rendered. Measured 6ms -> 29ms on that worst-case client and range.The three status routes (approved, unapproved, requires-feedback) constrain the status themselves and there is no suppressed route, so no page loses its own rows.
Note on the commit list
This branch carries
6e7f66a7(include-in-reports in the register) and its revert. That commit was only ever on a local staging; it never reached this remote. The net diff of this branch againststagingis exactly the transactions fix below — the add and the revert cancel out. Both are kept so local staging reconciles cleanly after merge.Testing
test/clj/auto_ap/ssr/transaction/common_test.clj— 6 assertions, passing. Covers the suppressed row being dropped fromids,all-idsandcount; the approved status route still listing its rows; and an all-suppressed client returning empty.auto-ap.ssr.transaction.import-testandauto-ap.ssr.ledger-testpass, with one exception:external-import-remove-button-testfails identically with and without these changes, so it is pre-existing and unrelated.auto-ap.ssr.transaction.edit-teststill has its knownapply-rule does not existcompile break, untouched here.lein cljfmt checkclean.Loose end, not addressed
:transaction/exclude-from-ledgeris defined inresources/schema.ednbut read nowhere in the codebase — only:invoice/exclude-from-ledgeris honored. If anything ever wrote that attribute expecting it to hide transactions, it never did.🤖 Generated with Claude Code