mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
The batched compliance read allows thirty calls a minute per ACTOR, and the journey spends that allowance twice over: it writes doses and then reads the resulting rates back off the same cabinet. On the shared account two siblings spend it as well — `refetch-nav.spec.ts` mounts `/medications` unstubbed and drives a client-side round trip back to it, and `delegated-writes.spec.ts` opens `/medications?new=1` on a SECOND session row of the same account, which is a different session but the same actor and therefore the same bucket. Add a serial group's retries and thirty reads inside one minute is reachable rather than theoretical. The cabinet has the same shape of problem in the other direction: the clear before each test deletes every medication row of the account it runs on, and that is today the account every other authenticated spec holds. So the journey gets its own account and its own jar. The rate-limit bucket, the medication cabinet and the dashboard tile's denominator become private at once. Two fixture repairs ride along, because they are the same helper: - The clear now goes out as the app's own DELETE per row instead of one raw `DELETE FROM medications`. Three fifteen-minute per-user cells hold medication state and a raw statement evicts none of them; the file survived only because every test happened to write through the API afterwards, which is an accident of ordering rather than a property. The rows are still enumerated in SQL, because the list route serves a memoised shape and a row it has not caught up with would hide from it. - `ageMedication` takes both stamps from its caller instead of deriving them from `CURRENT_DATE`. That resolves in the database session's zone — UTC in CI — while the plan dates the spec sends are computed in the browser's pinned Europe/Berlin, so between midnight and 02:00 the row silently started a day earlier than the caller asked for. The docstring now says `starts_on` is overwritten, not adjusted.