Cold reload left IndexedDB/OPFS intact when executor/store singletons
were null. Wipe adapters directly, clear both mirror backends, and
always revoke the session even if storage wipe fails.
Move TanStack mirror row collections out of opsMirrorClient so
opsDomainOutbox can update them without a madge cycle through
collectOpsDomainOutboxKeys.
Add baseUpdatedAt CAS on domain staff writes, assertCampaignDocCas helper,
opsDomainOutbox with hybrid forms (Manter/Usar), and int/unit pins.
Closes#176.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Wire OfflineBoundary + OpsListLocal on the eight ops list routes. Local
reads the ops mirror with subscribeChanges, applies canonical URL parsers
for filter/sort/page, and keeps KPIs/edit/saved-filter writes honest
offline. Extract demand/organization list URL modules for client use.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Align list view-model test fixtures with updatedAt, justify the CAS
advisor read bypass, and remove createOfflineAction metadata the
TanStack API does not accept.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Add baseUpdatedAt CAS for declareVotes, municipalityUpdate, political
trend, engagement level, and advisors. Sibling outbox executor wires
hybrid controls when OPS_HYBRID is on; flag OFF keeps legacy paths.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Extract presentational header shared by RSC and offline Local; OfflineBoundary
swaps to mirror-backed Local only when OPS_HYBRID is on and the browser is
offline (sync failure stays on RSC + chrome). Closes#172.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
- HybridPledgeEstimateForm lê valores de votePledgesCollection (não props RSC)
- Outbox faz patch optimista no mirror e aplica write do servidor com estimatedAt
- Helpers read/subscribe/patch no opsMirrorClient + mapper mapVotePledgeWriteToOps
- Testes unitários para merge protegido, patch optimista e mapper de write
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Bootstrap the campaign ops mirror behind OPS_HYBRID for staff: hydrate
TanStack localOnly collections from OPFS file (IDB fallback), GET
/campanha/api/ops-sync with mergeOpsSnapshot (outbox-aware), poll every
3 min in foreground, and show discreet sync chrome in the shell.
Leaders stay no-op even when the flag is on.
Closes#168
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>