From 3ffb661da334f5688d6004505e4e2f24067e6b71 Mon Sep 17 00:00:00 2001 From: Bryce Date: Thu, 18 Jun 2026 21:40:31 -0700 Subject: [PATCH] fix(ssr): stop unresolved filter flipping to true on transactions navigation The unresolved/potential-duplicates query-param decoders fell through to (boolean %) for unrecognized strings. A round-tripped "false" (pushed into the URL, re-read via HX-Current-URL) decoded to true since any non-nil string is truthy, so navigating pages silently turned on the "Unresolved only" filter. Handle "false" and already-boolean values symmetrically. Co-Authored-By: Claude Opus 4.8 --- src/clj/auto_ap/ssr/transaction/common.clj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/clj/auto_ap/ssr/transaction/common.clj b/src/clj/auto_ap/ssr/transaction/common.clj index 9d9abeec..210bd3d5 100644 --- a/src/clj/auto_ap/ssr/transaction/common.clj +++ b/src/clj/auto_ap/ssr/transaction/common.clj @@ -36,9 +36,9 @@ [:import-batch-id {:optional true} [:maybe entity-id]] [:unresolved {:optional true} [:maybe [:boolean {:decode/string {:enter #(cond (= % "on") true - (= % "") false - :else - (boolean %))}}]]] + (= % "true") true + (boolean? %) % + :else false)}}]]] [:description {:optional true} [:maybe [:string {:decode/string strip}]]] [:memo {:optional true} [:maybe [:string {:decode/string strip}]]] [:vendor {:optional true :default nil} [:maybe [:entity-map {:pull [:db/id :vendor/name]}]]] @@ -50,9 +50,9 @@ [:location {:optional true} [:maybe [:string {:decode/string strip}]]] [:potential-duplicates {:optional true} [:maybe [:boolean {:decode/string {:enter #(cond (= % "on") true - (= % "") false - :else - (boolean %))}}]]] + (= % "true") true + (boolean? %) % + :else false)}}]]] #_[:status {:optional true} [:maybe (ref->enum-schema "transaction-status")]] [:exact-match-id {:optional true} [:maybe entity-id]] [:all-selected {:optional true :default nil} [:maybe :boolean]]