Subsequent fetches of the same source re-upsert every access entry. Without a guard, a reviewer's (or an agent's) decision, its note, and the flags that drove it would be silently replaced on every poll. The ON CONFLICT DO UPDATE SET clause now refreshes only the columns that track live source state (email, full_name, role, is_admin, MFA, etc.) and deliberately omits the verdict bundle -- flags, flag_reasons, decision, decision_note, decided_by, decided_at -- so the audit trail stays consistent with whatever the reviewer or agent last recorded. Tighten the signature from pg.Querier to pg.Tx to match the rest of the coredata package -- every caller already runs inside WithTx. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
20 KiB
20 KiB