fix(arc-auth): source is first-touch, never overwritten on update (po-96l) - #1660
Conversation
source records how a person was acquired and must be set once at create time only. Including it on every PATCH silently overwrote a person's original acquisition channel whenever a second surface wrote the same row. Match filter (email or login+source) is unchanged β this only touches the write payload. (po-96l)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
|
|
Caution Review failedThe pull request is closed. βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: π Files selected for processing (2)
π WalkthroughWalkthroughCRM signup payloads now send ChangesCRM attribution preservation
Estimated code review effort: 2 (Simple) | ~10 minutes β¨ Finishing Touches π‘ 1π οΈ Fix failing CI checks π‘
π Generate docstrings
π§ͺ Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
sourcewas in the CRM upsert payload unconditionally while the email path matches onemails.primaryEmailalone β so any repeat signup through a different surface rewrote the acquisition channel, silently: no error, nothing in the logs, row still looks healthy.Now added to the payload only on the POST (create) branch, never the PATCH (update) branch. First-touch wins:
sourcemeans how we acquired this person, which cannot change on a later visit.The no-email fallback match filter is untouched β it still keys on
and(name.firstName[eq]:β¦,source[eq]:β¦), which is po-k6n's fix stopping a CLI sign-in from overwriting a/buildrow. Filter = how we find the row; payload = what we write.Reproduced live before the fix
Row
5f85a9c5,createdAtunchanged at 09:25:48 β a PATCH, not a new row.Verification
scripts/verify.shexit 0, 19 commands, stages setup lint typecheck test build. The after-test (same loop, source must remainSTAGING_TEST) runs post-deploy.π€ Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Tests