From 0a543abd187f76d6a2bfed5e334d69d515cccad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 8 Aug 2026 15:51:54 +0200 Subject: [PATCH] refactor(vaccinations): drop the dependent-keys bundle nothing consumes yet The dead-code gate is right: a bundle with no caller is dead code. The capture surface brings it back with the mutation that needs it, and the key module says what that bundle will have to evict. --- src/lib/query-keys/index.ts | 14 -------------- src/lib/query-keys/vaccinations.ts | 11 +++++++---- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/lib/query-keys/index.ts b/src/lib/query-keys/index.ts index e4f08f7c6..0ab335a29 100644 --- a/src/lib/query-keys/index.ts +++ b/src/lib/query-keys/index.ts @@ -254,20 +254,6 @@ export const encounterDependentKeys = [ queryKeys.practitioners(), ]; -/** - * Keys invalidated when a dose changes. - * - * The preventive-care root rides along, and it is the whole reason this is a - * bundle rather than one key: logging a dose satisfies the booster reminders - * it answers, so the checkups list is stale the moment the dose saves. - * Evicting only the immunization list would leave a booster on screen that - * the server had already moved a decade out. - */ -export const vaccinationDependentKeys = [ - queryKeys.vaccinations(), - queryKeys.measurementReminders(), -]; - /** * Invalidate every key in the bundle in parallel. Use this from mutation * `onSuccess` handlers so the call site stays a one-liner instead of repeating diff --git a/src/lib/query-keys/vaccinations.ts b/src/lib/query-keys/vaccinations.ts index 60d8c10b3..3c8ca4ce0 100644 --- a/src/lib/query-keys/vaccinations.ts +++ b/src/lib/query-keys/vaccinations.ts @@ -17,10 +17,13 @@ * like coverage. It belongs in the release that puts doses into one of those * payloads, alongside the reader that makes it necessary. * - * The one server-side cache a dose CAN move belongs to somebody else: logging - * one satisfies a booster reminder, which is a preventive-care write. That - * eviction is the reminder module's, and the client bundle below invalidates - * the reminder keys for the same reason. + * There is no dependent-keys bundle here yet either, and that omission is the + * same rule one layer up: a bundle with no caller is dead code, and the gate + * says so. When the capture surface lands it brings its own, and that bundle + * has to evict the preventive-care root alongside this one — logging a dose + * satisfies the booster reminders it answers, so the checkups list goes stale + * in the same tick. Evicting only the immunization list would leave a booster + * on screen that the server had already moved a decade out. */ export const vaccinationKeys = { /**