feat: implement patch 19#26
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughImplements a complete follow system enabling users to follow/unfollow each other and view follower/following lists. Adds database schema with Changes
Sequence DiagramsequenceDiagram
actor User as Signed-in User
participant Web as Web Client
participant API as API Server
participant DB as Database
User->>Web: Click follow button on profile
Web->>API: POST /user.follow { targetUsername }
API->>DB: BEGIN TRANSACTION
DB->>DB: INSERT INTO user_follow (followerId, followingId, status)
DB->>DB: UPDATE user SET total_following = total_following + 1
DB->>DB: UPDATE user SET total_followers = total_followers + 1
DB->>DB: COMMIT TRANSACTION
API->>Web: { ok: true }
Web->>Web: Invalidate follow state query
Web->>API: GET /user.getFollowState { targetUsername }
API->>DB: SELECT * FROM user_follow WHERE followerId = ? AND followingId = ? AND status = 'accepted'
API->>Web: { isFollowing: true }
Web->>User: Show success toast, update UI
rect rgba(200, 150, 100, 0.5)
User->>Web: Click followers count to open dialog
Web->>API: GET /user.listFollowers { username, limit, cursor? }
API->>DB: SELECT * FROM user_follow WHERE followingId = ? ORDER BY createdAt DESC LIMIT limit+1
API->>Web: { items: [...profiles], nextCursor: ... }
Web->>Web: Render followers list with IntersectionObserver
Web->>User: Display paginated followers list
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Summary by CodeRabbit