In apps/backend/src/routes/follow.ts, the code checks reply.statusCode to decide whether to log a successful follow:
if (reply.statusCode === 200 || reply.statusCode === 204) {
app.prisma.followLog.create({ data: { status: 'success' } })...
}
However, reply.statusCode is 200 by default before any response is sent. So this condition is always true at that point, meaning failed follows (e.g. 401, 404 from GitHub) are also logged as status: 'success'.
Expected behaviour
Only genuine successful follows should be logged as 'success'.
Proposed fix
Instead of checking reply.statusCode, check the actual response from the platform API directly:
// In followGitHub, return a boolean or throw on failure
// Then log based on that result, not reply.statusCode
Files to touch
apps/backend/src/routes/follow.ts
ASSIGNMENT REQUEST — add this at the very bottom of the issue body:
I would like to work on this issue as part of GirlScript Summer of Code 2026 (GSSoC'26). I have reviewed the codebase and understand the root cause and the fix required.
Could you please assign this issue to me?
GitHub: @MehtabSandhu11
Thank you!
In
apps/backend/src/routes/follow.ts, the code checksreply.statusCodeto decide whether to log a successful follow:However,
reply.statusCodeis 200 by default before any response is sent. So this condition is always true at that point, meaning failed follows (e.g. 401, 404 from GitHub) are also logged asstatus: 'success'.Expected behaviour
Only genuine successful follows should be logged as
'success'.Proposed fix
Instead of checking
reply.statusCode, check the actual response from the platform API directly:Files to touch
apps/backend/src/routes/follow.tsASSIGNMENT REQUEST — add this at the very bottom of the issue body:
I would like to work on this issue as part of GirlScript Summer of Code 2026 (GSSoC'26). I have reviewed the codebase and understand the root cause and the fix required.
Could you please assign this issue to me?
GitHub: @MehtabSandhu11
Thank you!