mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +00:00
A leaf on a share link can be absent from the payload for two reasons that look identical downstream: the owner shared it and recorded nothing, or they shared it and the domain is switched off on their account. The aggregator ANDs the selection and the module map and returns the same null either way, so the recipient could not tell an empty section from one that never had a chance to carry anything. `loadShareViewData` now resolves the whole module map — it needed the `doctorReport` key from it anyway — and returns `unavailableLeaves`: the leaves the link DOES carry whose owning module is off. Only selected leaves appear, because a withheld leaf's module state is not the recipient's business in any direction. The map is deliberately NOT handed to the aggregator. The third argument is the frozen selection and there is no fourth, which is what keeps this surface from growing an options object that widens what it asks for; the resolver memoises its reads per request, so the aggregator resolving its own map again costs no round-trip. The module-gate suite moves off `isModuleEnabled` with it, and gains three cases for the new verdict, including the one that proves an unshared leaf is never named.