teqo/src
Francisco Ignácio Fontoura Solla 2bbb630af6 simplify(B27): fix optimistic-state clobber, unify JSON route error shell, dedupe advisor id resolution
- MunicipalityListAdvisorsControl: stop advancing lastPropsIDsRef from a
  successful delta response — it exists only to detect a genuine external
  prop change, and writing it there made a later stale re-render of the
  pre-edit content look external and clobber optimistic state back to it.
  Also reconcile with the latest confirmed server set on the error path
  once every in-flight delta settles (previously only the success path did),
  and consolidate chip/tooltip name resolution onto the shared
  advisorEntriesFromIds helper instead of a bespoke lookup with an
  '#id' placeholder.
- Extract campaignJsonMutationErrorResponse/parseCampaignJsonRequestBody
  (src/utilities/campaignJsonMutationRoute.ts) and adopt them in both
  municipios/advisors/route.ts and municipios/expected-votes/route.ts,
  removing the duplicated body-parse + error-mapping ladder.
- Municipality.ts's validateMunicipalityAdvisors now uses
  uniqueRelationshipIds instead of re-inlining the Set+map+filter dance
  the helper was extracted for.

Verified: tsc --noEmit, lint, format:check, check:cycles all clean;
full unit suite (450 tests) and the municipality/advisor int suites pass.
knip's pre-existing payload.config.ts load error is unrelated (P3).
Playwright's spawned webServer failed to boot in this sandbox (unrelated
module-resolution environment issue, reproduced even before this diff);
manual pnpm dev boots fine and the change is covered by unit/int tests.
2026-07-26 03:51:32 -03:00
..
app simplify(B27): fix optimistic-state clobber, unify JSON route error shell, dedupe advisor id resolution 2026-07-26 03:51:32 -03:00
collections simplify(B27): fix optimistic-state clobber, unify JSON route error shell, dedupe advisor id resolution 2026-07-26 03:51:32 -03:00
components simplify(B27): fix optimistic-state clobber, unify JSON route error shell, dedupe advisor id resolution 2026-07-26 03:51:32 -03:00
globals Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
hooks Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
lib B27: combobox + chips + auto-save no popover de Assessores da lista de municípios 2026-07-26 03:31:51 -03:00
migrations C13 pos-simplify: fecha os residuos da varredura e estreita os guards 2026-07-25 21:29:32 -03:00
utilities simplify(B27): fix optimistic-state clobber, unify JSON route error shell, dedupe advisor id resolution 2026-07-26 03:51:32 -03:00
css-modules.d.ts Adopt TypeScript 6 for tooling and TypeScript 7 for typecheck. 2026-07-21 20:32:15 -03:00
payload-types.ts C13 pos-simplify: fecha os residuos da varredura e estreita os guards 2026-07-25 21:29:32 -03:00
payload.config.ts C13: renomeia "Plano de Acao" para "Atividade" em toda a vertical /campanha 2026-07-25 20:50:38 -03:00