fix(oauth): persist inviter for OAuth registrations#5766
fix(oauth): persist inviter for OAuth registrations#5766zhangzhichaolove wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe transactional OAuth user insert now assigns ChangesOAuth inviter persistence
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
Important
📝 变更描述 / Description
OAuth 注册新用户时,后端已经从 session 中解析邀请人的
aff并得到inviterId,但事务插入路径InsertWithTx没有把该值保存到用户的inviter_id字段,导致 OAuth 注册用户缺少邀请归属。本次修改让
InsertWithTx在创建用户前写入user.InviterId = inviterId,使 OAuth 注册与普通密码注册保持一致。同时新增模型层回归测试,覆盖有邀请人和无邀请人两种 OAuth 用户创建场景。🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
本地验证通过:
go test ./model结果:
Summary by CodeRabbit