Two related fixes for one root cause: the legacy walks schema's flat contactId field was fanned out at migration time into four new-schema fields (groupEvent.walk_leader.id/name, fields.contactDetails.contactId, fields.publishing.ramblers.contactName), and the current edit UI only keeps three of those four in sync when a leader is selected. Any stale override on the legacy contactId therefore stayed embedded in groupEvent.walk_leader indefinitely, and the copy-from-previous-walk flow then propagated it onto every walk copied from such a record.
Reported by Kerry O'Grady after Jenny Brown's Bearsted Circular walk copied on 2026-04-19 came through with Nick Barrett as the Ramblers contact. Tracing the affected 2026 walk and its 2024 source confirmed the chain: a 2024 admin override of contactId, faithfully migrated, then faithfully spread-merged forward in 2026.
copyDetailsFromPreviousWalk() previously did { ...targetFields, ...sourceFields } { ...targetGroupEvent, ...sourceGroupEvent } which let the source walk's leader-shaped fields win the merge.
Now, after the merge, rebuildLeaderIdentity re-derives every leader field from the draft's own pre-merge contactDetails.memberId via eventDefaultsService.memberToContact:
The publish booleans on both channels are preserved so the copier's on/off choices survive. groupEvent.status is also deleted on the clone so the source walk's "confirmed" status does not silently promote the new draft past its approval gate.
The previous deletes of fields.contactDetails, fields.publishing, and groupEvent.walk_leader on the clone are no longer needed - the rebuild is now authoritative for all four leader fields, anchored on the draft's pre-merge memberId.
The code fix prevents new leakage but does not heal walks already in the database with stale groupEvent.walk_leader from the migration-time fan-out. Idempotent backfill:
Re-runs find every doc already matching and perform no writes, so the migration is safe to replay during rollout or after partial runs. fields.contactDetails.contactId and fields.publishing.ramblers.contactName are intentionally not touched: the leader-toggle UI in walk-edit-leader.ts lets users diverge them from the member record on purpose, and the backfill should not undo that.
Runs automatically on deploy alongside the rest of the schema migrations