From dd04931c9d2ae4d49df68952059080c4477067f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 8 Aug 2026 15:22:13 +0200 Subject: [PATCH] chore(query-keys): restore the visit invalidation bundle with its consumers The bundle landed a release before the surfaces that read it and was removed on trunk as dead. Both mutation hooks in this branch use it, and the merge took trunk's deletion, so it comes back here together with the writes that need it. The comment now names its consumers, so the next dead-code sweep can see them without reading two files. --- src/lib/query-keys/index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/lib/query-keys/index.ts b/src/lib/query-keys/index.ts index f418db1a7..5d8250051 100644 --- a/src/lib/query-keys/index.ts +++ b/src/lib/query-keys/index.ts @@ -238,6 +238,25 @@ export const medicationDependentKeys = [ */ export const cycleDependentKeys = [queryKeys.cycle(), queryKeys.insightsRoot()]; +/** + * Keys invalidated when a visit or an address-book entry changes. + * + * Both roots ride together in one bundle rather than two, because the two + * writes reach each other: renaming a practice changes the label every visit + * that names it renders, and deleting one nulls the reference on visits that + * stay. A bundle that evicted only the surface being written would leave the + * other showing the pre-write name. + * + * `useEncounterMutations` and `usePractitionerMutations` are its consumers. + * It briefly had none — the roots landed a release before the surfaces that + * read them — and was removed on trunk for that reason; it is back here + * together with the writes that need it. + */ +export const encounterDependentKeys = [ + queryKeys.encounters(), + queryKeys.practitioners(), +]; + /** * 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